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)
How to find out previous taks
meikel
Hi,
I have an external task, which can be called by a several tasks.
Is there a way to find out, which task "called" this external task?
regards
meikel
Find more posts tagged with
Comments
Michael
Sure
From the WF manual re externaltask:
... When the program is run by the workflow system, the following arguments are
passed in after any of the previously mentioned desired command line arguments:
job id (integer)
task id (integer)
area vpath (string)
In your script you can then
use TeamSite::WFtask;
my $task = new TeamSite::WFtask($taskid);...
... and $task->GetDescription(); (or what have you)
to determine where you were called from.
hth
Cheers
Michael
Migrateduser
That's not accurate. The task ID that is passed to the externaltask is the task ID of the externaltask. So all you'd be doing is getting the description of its own task - not too useful in this case. In order to figure out which task preceeded the externaltask, I can think of a couple ways off the top of my head.
o Parse the output of iwgetwfobj for the job
o Have every path that takes you to the externaltask contain another externaltask that sets a job variable indicating which path it took.
There are probably other ways to do it as well.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Adam Stoller
I haven't tried this out - but as of 5.5.2 SP3 [perhaps SP2?] there's a potentially nifty little sub-elementyou can set in your task definitions that would probably help:
wfvarfinishop
(see the WF manual, p. 127 for more details - although you'll probably want to ignore the typo that begins the description with
wfvarstartop
;-))
Basically, I believe you could set a job variable like "
lastTask
" to be the name of the current task - since this should theoretically happen just prior to task transition, the externaltask could reference that variable and get the
name
of the task that
called
the externaltask, and then do a lookup by name (if desired) to get additional information about that task (including, but not limited to, its taskID).
I'm currently without a version of TS on my laptop, so I cannot provide any additional insight from empirical evidence - I'll leave that up to you.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com