Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Skip an external task
System
Hello,
I have a TAG_info that contains an optional e-mail field. If the field is filled in by the user, an external task is executed to send a mail the the specified e-mail address (already implemented) but if the field is left blank, I would like to skip the execution of the external task.
How can this be done (At the moment the external task is always executed, even when the field is blank) ?
Thanks in advance!
Find more posts tagged with
Comments
reddyl
You check the value of TAG_info on job instantiation to either include the externaltask or not.
Migrateduser
Sorry if my question looks stupid (I am not used to workflows) but how can I do this (include the external task) ?
I can only write perl code in the <template_script> section while the external task is somwhere under <workflow ..>
JonathonG
You can create multiple template_script sections, and wrap the external task with some conditional logic. Of course, then you also have to fix all of the successors/predecessors as well. This is a great case where you want to look at using the WFconstructor perl module. You should be able to get docs on it by running: <iw-home>/iw-perl/bin/perldoc TeamSite::WFconstructor. Specifically, check out the concept of dormant tasks.
Jonathon
Interwoven Developer
Allstate, Inc.
reddyl
you can use <template_script> element to enclose the perl code even inside the <workflow ...> element.
<template_script><![CDATA[
..........
TAG_info(
email_address =>
[ html => "<input type="text"></text>",
label => "Eamil Address",
]
);
..........
]]></template_script>
<workflow ... >
<template_script><![CDATA[
my $email = __VALUE__("email_address");
if($email){
LOGIC to include email external task
}else{
LOGIC to exclude email external task
}
]]></template_script>
</workflow>
- Reddy
Adam Stoller
Alternatively you can do the entire workflow within the template_script section - using TeamSite::WFconstructor module (look at some of the "solutions" workflows for examples as well as reading the perldoc on TeamSite::WFconstructor)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
I didn't know there can be multiple <template_script> sections...
Now I see how to manage this, thanks !
I'll have a look at the TeamSiite::WFconstructor module later, this sounds like the best way to proceed! (I hate the way workflows are managed)
JeremyH
Another alternative is to move the check to the external task. Near the start of the script, check to see if there is an email address present. If not, do an immediate callback.
Bhargav Coca
One Alternative is to go with a Perlmodule which contains your getmail() function and the external tsk init. Let your wft call this module everytime, by passing task id, job id, and the value of your field. Depending on either 0 or 1, manipulate the execution of the external task inside this perl module.
Thank you