Hello All,
please, help!!! I have a workflow (below). How could I check mm/dd/year field before submition?
<!-- ============================================================
Copyright 1999, 2000 Interwoven, Inc.
All Rights Reserved
============================================================ -->
<workflow name="timed_deploy"
owner="__TAG__('iw_user');"
creator="__TAG__('iw_user');"
description="__TAG__('iw_desc');">
<template_script>
<![CDATA[
######################################################################
# This next section creates a workflow variable containing the root
# URL to use for file references. This is used by the iwsend_mail.ipl
# script when presenting the list of files in the body of the email
# message.
######################################################################
]]>
</template_script>
__INSERT__("
<variables>
<variable key='http_host' value='$ENV{HTTP_HOST}'/>
</variables>
");
<template_script><
|;
$wapath =~ s|/\s*$||;
return("$wapath", "$iwbpath", "$wapath", "TRUE");
}
($bpath, $wapath, $avpath) = cleanup_paths(__VALUE__("$btag"),
__VALUE__("$watag"));
return("$avpath", "$bpath", "$wapath", "FALSE");
}
my($area_vpath, $branch_path, $work_area, $skip_branch) =
set_area("branch_path", "work_area");
#======================================================================
# Set some variables for later use
#======================================================================
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $iwmount = TeamSite::Config::iwgetmount();
my($iw_user) = __VALUE__('iw_user');
my($deployfile) = __VALUE__('deployfile');
my($dtime) = __VALUE__('timeoutd').__VALUE__('timeoutt');
my($wft_desc) = "Depoyment Schedule - Date: ".__VALUE__('timeoutd')." Time: ".__VALUE__('timeoutt');
#======================================================================
# JOB FORM DATA CAPTURE
#---------------------------------------------------------------------
# This section capture the necessary data on the job creation form in
# order to dynamically assemble a workflow.
#======================================================================
sub debug{
TAG_info(
iw_output_file => "<input type='text' value='/tmp/foo.xml'>",
iw_debug_mode =>
"<input type='radio' value='true'>True</input>" .
"<input type='radio' value='false'>False</input>",
);
}
#======================================================================
# Uncomment following line if you wish to enable workflow debugging.
#======================================================================
#&debug;
TAG_info(
serverinfo =>
[ html => "<input type='radio' checked name='serverinfo' value='on'>Server Timestamp: ". localtime(time()) ,
label => "Server Information",
],
timeoutd =>
[ html => "Date (MMDDYYYY) <input type='text' maxlength='8' name='timeoutd' size='8'>",
label => "Deployment Date",
],
timeoutt =>
[ html => "Time (HHMM) <input type='text' maxlength='4' name='timeoutd' size='4'>",
label => "Deployment Time",
],
revert =>
[ html => "Off<input type='radio' name='revert' checked value='off'> On<input type='radio' name='revert' value='on'>",
label => "Revert",
],
iw_desc =>
[ html => "<textarea rows='5' cols='40'></textarea>",
label => "Job Description",
error_msg => 'Please enter a description',
],
);
#=====================================================================
# 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
# Sambre-Jankens transform
@submit_file = map {
TeamSite::CGI_lite::escape_html_data($_);
} sort map {
s|\\|/|g;
s/^\Q$area_path\E//;
$_;
} __VALUE__('iw_file');
}
#=====================================================================
# XML JOB SPECIFICATION SKELETON
#---------------------------------------------------------------------
# This XML section is used to generate the job specification files
# based on input provided by the end-user in the job creation form.
#=====================================================================
]]>
</template_script>
<!-- ================== Add Files =============================== -->
<usertask name="Submit_Files"
owner="__TAG__('iw_user');"
__INSERT__("description='$wft_desc'");
start='t'
lock='t'
readonly='f'>
__INSERT__("<areavpath v='$area_vpath'/>");
<successors>
<successorset description="Submit_and_Deploy">
<succ v="Time_Out"/>
</successorset>
<successorset description="Cancel">
<succ v="End"/>
</successorset>
</successors>
<template_script>
<![CDATA[
# insert file list if we have it
if (__ELEM__('iw_file'))
{
__INSERT__("<files>");
for (my $i=0; $i <
@submit_file; ++$i)
{
__INSERT__("<file path='$submit_file[$i]' comment='taskfile'/>");
}
__INSERT__("\n\t</files>");
}
]]></template_script>
</usertask>
<!-- ============================================================ -->
<!-- =================== Time Out ================================= -->
<dummytask name='Time_Out'
owner="__TAG__('iw_user');"
start="f"
description="Timed Out.">
__INSERT__("<timeout v='$dtime'>");
<succ v="Submit"/>
</timeout>
<activation>
<pred v="Submit_Files"/>
</activation>
</dummytask>
<!-- ============================================================ -->
<!-- ========================== Submit ============================ -->
<submittask name='Submit'
owner="__TAG__('iw_user');"
description="__TAG__('job_name');">
__INSERT__("<areavpath v='$area_vpath'/>");
<successorset>
<succ v='End'/>
</successorset>
<activation>
<pred v="Time_Out"/>
</activation>
</submittask>
<!-- ============================================================ -->
<!-- =================== Deploy Now================================ -->
<externaltask name="Deploy_Now"
start="f"
owner="__TAG__('iw_user');"
description="Deploying."
lock="f"
immediate="t">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="Submit">
<succ v="User_Notification"/>
</successorset>
</successors>
__INSERT__("<command v='$iwhome/httpd/iw-bin/wcwft_deploy.ipl $branch_path $revert $deployfile $publish'/>");
<activation>
<pred v="Submit"/>
</activation>
</externaltask>
<!-- ============================================================ -->
<!-- =================== User Notification ============================ -->
<externaltask name="User_Notification"
owner="__TAG__('iw_user');"
description="Please complete this task."
lock='t'
readonly='t'>
__INSERT__("<areavpath v='$area_vpath'/>");
<successors>
<successorset description="Initiation: Approver_Work">
<succ v="End"/>
</successorset>
</successors>
__INSERT__(get_mail_cmd("$iwhome", "$iw_user"));
<activation>
<or>
<pred v="Deploy_Now"/>
</or>
</activation>
</externaltask>
<!-- ============================================================ -->
<!-- ========================= End =============================== -->
<endtask name="End">
<activation>
<or>
<pred v="User_Notification"/>
<pred v="Submit_Files"/>
</or>
</activation>
</endtask>
</workflow>