Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How do I get Workflow type from external command
System
I have a perl script that is triggered as an external command from a workflow. I would like the script to do different things depending on if the workflow is triggered by a submit or a tt_deletedcr. How do I find out from within my script ? There seem to be no appropriate values in the task or workflow objects. Failing a solution to this I realize that I can create completely separate workflows and commands for each of the submit and delete scenarios but this seems like overkill.
Your help much appreciated ...
Find more posts tagged with
Comments
Migrateduser
I believe you could set a workflow variable at job creation time and have your script check that (if the command is available to the .wft - I am not sure it is - do a view source on the workflow instantiation form and check for a hidden variable containing this value).
Migrateduser
Thanks John, but at the risk of sounding stupid, how do I find out if it's a delete or a submit at job creation time ? (Without asking the user to explicitly set a variable)
Migrateduser
I don't really use the default workflow instantiation system so I can't test this, but if you begin to start a workflow for a file, then do a view source on the dialog that pops up (asking you for job description and other parameters), you *may* see a hidden variable containing the command that was used to start the job (I am pretty sure this would be undocumented and therefore not supported). If you see it you can use it just like any other TAG_info variable, if you can't see it then I imagine you would prompt the user somehow.
word.docx
Migrateduser
Checked out the code for the presubmit dialog box. Doesn't seem to be anything indicating the command used to start the workflow though unfortunately.
Looks like I'm gonna have to code seperate Worflows and scripts for delete and submit.
Thanks for the suggestions though
james1
I think the worst case is separate WFTs, but not separate scripts.
If you just take the WFT you have, you can modify it to hard-code a job variable to "submit" (for example), and then make a copy of the WFT and hard-code the copy to set the job variable to "tt_data" (for example). The two WFTs could use the same external task command script. All the script has to do is look for the job variable.
Or, if the script's behavior is *that* different, then it might not be a bad thing to have two separate scripts.
My point is: You have options. I don't think that you *have* to go one way or the other.
-- James
--
James H Koh
Interwoven Engineering
Migrateduser
How hard would it be to add the command to the instantiation engine? It seems like it would be available and useful. I can't imagine maintaining multiple copies of one wft for this simple thing.