hello,
i have a workflow on 5.5.2 and i am trying to make it work in 6.5 sp2/3 but i think i have problem in the logic of the workflow. while i am working on it, i thought i post it on here maybe somebody would see the problem before me.
this is the workflow, is there anything visible that might be causing the invalid workflow error?
[HTML]
\n";
for (my $i = 0; $i <
@flist; ++$i) {
$files .= "\t\n";
}
$files .= "\n";
}
return($files);
}
#=====================================================================
# dynamically generated command list for external task
#=====================================================================
my($iw_get_external_command_line) = iw_get_external_command_line();
#=====================================================================
# Name: iw_get_external_command_line
# Args: None.
# Usage: $xml = iw_get_external_command_line();
# Purpose: Generate an XML formatted command line for the external
# task that includes a comma-separated list of the
# pre-selected when the workflow was initiated.
# Returns: Returns the XML formatted command line for the external
# task.
# Notes: Sorts the filelist in uuencode form, then html-encodes
# each entry using a library routine - all this using
# the Sambre-Janken transform algorithm
#=====================================================================
sub iw_get_external_command_line{
#===============================================
# Declare variables
#===============================================
my($input_dir) = "-inputDir Y:\\default\\main\\BRANCH\\dev\\STAGING";
my($output_dir) = "-outputDir Y:\\default\\main\\BRANCH\\static\\WORKAREA\\static_workarea";
my($log_file) = "-logDir

\\site\\log";
my($config_file) = "-configFile

\\site\\cfg\\site_config.txt";
my($pass_dirs) = "";
my($pass_files) = "";
my($pass_targets) = "";
my($command_line) = "";
#-----------------------------------------------
# Generate comma-separated file list
#-----------------------------------------------
if (__ELEM__('iw_file')){
my(
@pass_flist) = map {
TeamSite::CGI_lite::escape_html_data($_);
} sort map {
tr|\\|/|;
s|^\Q$iw_area_vpath\E||;
$_;
} __VALUE__('iw_file');
# Append files together adding command and space
for (my $i = 0; $i <
@pass_flist; ++$i) {
$pass_targets .= "$pass_flist[$i],";
}
# Remove trailing comma and prepend options for TARGETS
$targets_length = length($pass_targets);
$pass_targets = substr $pass_targets, 0, $targets_length - 1;
$pass_targets = "-targets ".$pass_targets;
}
#-----------------------------------------------
# Generate command line for external task
#-----------------------------------------------
#$command_line = "
";
#-----------------------------------------------
# Return command line for __INSERT__ directive
#-----------------------------------------------
return($command_line);
}
#=====================================================================
# Determine submit workflow for given branch
#=====================================================================
#-----------------------------------------------
# Declare variables - default = DEV
#-----------------------------------------------
my($successorset_submit_task) = "TransformIt";
my($external_task) = qq{
$iw_get_external_command_line
};
my($activation_end_task) = <<"END_OF_TEXT";
END_OF_TEXT
my($log_task) = <<"END_OF_TEXT";
END_OF_TEXT
#===============================================
# Retrieve sub-branch - STATIC vs. DEV
#===============================================
my($workarea) = __VALUE__('iw_workarea');
my($sub_branch) = "STATIC";
if ($workarea =~ /dev/) {$sub_branch = "DEV";}
else {$sub_branch = "OTHER";}
#-----------------------------------------------
# XML for dev
#-----------------------------------------------
if ($sub_branch ne "DEV") {
$successorset_submit_task = "end";
$external_task = "";
$log_task = "";
$activation_end_task = "";
}
###########################################################
#
# Set $DEBUG_MODE to 1 if you want to have option for debug output
#
$DEBUG_MODE = 1;
#
# Include JavaScript functionality for replicating file comment
#
my $pre_html =<<'EOS';
<SCRIPT LANGUAGE="Javascript">
function makeArray( elements )
{
var propNames = new Array();
for (var i = 0; i < elements.length; i++)
{
var elem = (typeof elements.item == 'undefined')?elements
:elements.item(i);
if (elem.name.indexOf('File_comment_') != -1)
{
propNames[propNames.length] = elem.name;
}
}
return propNames;
}
function copy_file_comment(win)
{
var first = null;
var nameList = makeArray ( win.document.forms[0].elements);
for (var i = 0; i < nameList.length; i++)
{
field_name = nameList;
if ((first == null) && (field_name == 'File_comment_0'))
{
first = win.document.forms[0].elements[field_name].value;
}
else
{
if (first != '')
{
win.document.forms[0].elements[field_name].value = first + '';
}
else
{
win.document.forms[0].elements[field_name].value = '';
}
}
}
}
</SCRIPT>
EOS
CGI_info(
pre_tagtable_html => $pre_html,
title => "Submit Workflow",
);
#----------------
# DEBUG OPTIONAL
#----------------
if ($DEBUG_MODE == 1)
{
TAG_info(
iw_debug_mode => [html => "Yes " .
"No ",
label => "" .
"Debug mode?" ,
is_required => "true",
],
);
}
# Force the form to show up at least once (because there are no
# required fields
if (!defined(__VALUE__(iw_first_time)))
{
TAG_info(
first_time_hidden_placeholder =>
[
html => "",
is_required => 'true',
],
);
}
#---------------------------------
# INPUT FIELDS FOR SUBMIT COMMENTS
#---------------------------------
# PRINT SELECTED FILES FOR DORIS
TAG_info(
files_selected =>
[ html => "",
label => __VALUE__(iw_get_filelist()),
is_required => 'false',
],
);
TAG_info(
submit_cmts_hdr =>
[ html => "",
is_required => 'false',
label => "".
"" .
"Submit Comments" .
"" .
""
],
);
TAG_info(
submit_cmt =>
[ html => "",
label => "Submit Comment:",
is_required => 'false',
],
info_cmt =>
[ html => "",
is_required => 'false',
label => "Submit Info:",
],
);
my $info_cmt = __VALUE__('info_cmt', 'html');
if ($info_cmt !~ /^\s*$/)
{
$info_tag = "";
}
else
{
$info_tag = '';
}
my $submit_cmt = __VALUE__('submit_cmt', 'html');
#---------------------------------
# INPUT FIELD FOR SUBMIT OVERRIDE
#---------------------------------
$thisbr = __VALUE__('iw_workarea');
$thisbr =~ s/\\/\//g;
$thisbr =~ s/.*default\/(.*)\/WORKAREA\/.*/\1/;
my $radio1_checked_string = '';
my $radio2_checked_string = 'checked';
my $override = __VALUE__('iw_setwfarg_iw_overwrite');
if ($override eq "true")
{
$radio1_checked_string = 'checked';
$radio2_checked_string = '';
}
TAG_info(
iw_override => [html => " Yes " .
" No",
label => "Override conflicts with STAGING?",
is_required => "true",
],
);
#-----------------
# Keep locks?
#-----------------
#
# 'yes' corresponds to 'f' because the value is used in the 'unlock'
# attribute of the submittask (i.e., inverse relationship)
#
#-----------------
TAG_info(
iw_keeplocks => [html => " Yes " .
" No",
label => "Keep locks?",
is_required => "true",
],
);
#------------------------------
# Comments for individual files
#------------------------------
TAG_info(
file_cmts_hdr =>
[ html => "",
is_required => 'false',
label => "" .
"" .
"Individual File Comments" .
""
],
);
# make sure the file list is defined
my @submit_file = (); # files sorted in unencoded
if (__ELEM__('iw_file')) # form, then html-encoded
{ # by hand via CGI_lite
@submit_file = map { TeamSite::CGI_lite::escape_html_data($_);
} sort __VALUE__('iw_file');
}
for (my $i=0; $i<@submit_file; ++$i)
{
my $comment_html = "" .
"" .
"$submit_file[$i]" .
"".
"";
if ($i == 0 && ($#submit_file > 0))
{
$comment_html .=<

Copy Comment

EOS
}
$comment_html .= "";
TAG_info(
"File_comment_$i" =>
[ html => "",
error_msg => 'Please enter a comment.',
is_required => 'false',
label => $comment_html,
],
);
}
sub submit_files_xml
{
my $xml = '';
if (__ELEM__('iw_file') != 0)
{
$xml .= "\n";
for (my $i=0; $i < @submit_file; ++$i)
{
$xml .= " \n";
}
$xml .= " \n";
}
return $xml;
}
]]>
__INSERT__(submit_files_xml());
__INSERT__("");
__INSERT__($info_tag);
__INSERT__($activation_end_task);
[/HTML]
that's the 6.5 version, if you want to see the 5.5.2 version let me know and i will post it.