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)
template_script inside External Task Element?
Ninerfan
Hi all,
In the task below I'm trying to dynamically assign the succ transition based upon the variable $deploy_now which is set globally in a previous template_script section in the top of the file. It was my understanding that all the template_script sections ultimatly make up one program so the variable should be available inside this section. However when I try to run the workflow I get errors that say:
"No succs in succossors" and "No successorset in task submit_dcr.
So it appears either the variable is not global or I'm not referring to it correctly or my __INSERT syntax is messed up.
Any Ideas appreciated.
-----------------------------------------------
<externaltask name = "submit_dcr"
owner = "tsadmin"
description = "__INSERT__($uDescription);"
override = "f"
start = "f" >
<areavpath v = "__INSERT__($areavpath);"/>
<successors>
<successorset description = "Generate list page if needed or else submit HTML file.">
<template_script>
if($deploy_now eq "y") {
__INSERT__(" <succ v = 'genList'/>\n");
} else {
__INSERT__(" <succ v = 'submit_html'/>\n");
}
</template_script>
</successorset>
</successors>
<command v = "__INSERT__($cSubmitDCR);"/>
<activation>
<pred v = "timeOut"/>
</activation>
</externaltask>
Find more posts tagged with
Comments
Adam Stoller
You forgot the CDATA tag:
<template_script>
<!CDATA[[
if($deploy_now eq "y") {
__INSERT__(" <succ v = 'genList'/>\n");
} else {
__INSERT__(" <succ v = 'submit_html'/>\n");
}
]]>
</template_script>
If that doesn't fix the problem - we'd have to see the rest of the WFT.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Ninerfan
Hi Fish,
Thanks for the tip. That was indeed my problem although the syntax needed was <![CDATA[ my script code here ]]>
However I still was not able to get it to work because once I tested it the workflow engine gave me an error when it tried to instantiate the job.
It basically complained that an <succ> element was NOT identified for submit_dcr task. As if the fact that I had it being assigned inside the template script block and the CDATA block hid it from the WF engine at job create time. That's really hard to believe because I would think this practice of trying to make an optional task would be a very common thing to do. Any thoughts on that? Thanks again.
-Ninerfan (our team sucks this year too).
Adam Stoller
Enable workflow debugging so that you can get a dump of the job description file - the look through that to see if you can figure out where something isn't getting processed correctly.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Ninerfan
Will do. Thanks for the help. ;-)