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 get previous task details
Dada
Hi,
Could anyone tell me how to get the previous task details from the current task?
My current task is an "externaltask" and I want to get the previous task details in this "externaltask" program.
Thanks in advance.
Regards
Tushar
Find more posts tagged with
Comments
Johnny
I couldn't see an obvious way from the PERL API's.
There are some undocumented methods in wftask like GetTransitionMade that returns the integer value of which successor set was chosen.
I think you might have to look at retrieving the wf job xml from the command line...
iwgetwfobj -r "jobid"
and parse that... but it seems like there must be a more obvious way.
John Cuiuli
gzevin
you could find out the task by name by running the following CLT:
<iwhome>/bin/iwgettaskbyname jobid task_name
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Johnny
There you go.
I knew there had to be a simplier way... thanks for the refresher Greg!
John Cuiuli
gzevin
Hi John
.. and you know you knew it!
your only excuse will be that you just travelled half a globe
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Johnny
yeah it was a pretty shabby attempt at my first response in a little while!!!
14 hour time difference is slowly wearing off!!!
You should be getting twice as many calls from Marios and the gang now
John Cuiuli
Adam Stoller
You are NOT guaranteed that the task whose taskid is one less than the current task's taskid is in fact the predecessor task.
If you know the name of the predecessor task within your wft, you can pass the name of that task to the externaltask and use the GetTaskByName() method already cited (via it's CLT function - the Perl method is in TeamSite::WFworkflow).
If you are dealing with a workflow in which it is possible to get to the externaltask from one or more other tasks - it's much more difficult, you would have to parse the output of iwgetwfobj to find the event history and then further parse that to get the task name or id (I can't remember which, I haven't tried doing this in a long time)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
milind
Hi,
If we have a look at the xml returned by command "iwgetwfobj" there is one tag
<predecessors>
<predecessor hasactivated="f" id="7581"/>
</predecessors>
I have observed that the flag hasactivated is not always set.
Have any one of you faced similar problem !
Regards
Milind
invalid datatype error.zip
ISCBorisB
This is actually not a "problem", rather it's one of the valid states of dynamically
changing WF Object. There can be many cases for Task object to have "hasactivated"
attribute equal false. For example, unassigned group task will look like that (state="inactive").
Depending on your wft, where you are in the flow and how you get there (first time, n-th time,
who your predecessor was this time round, etc... it all will look differently.
Perhaps we can help if you explain what are you trying to accomplish.
milind
Thanks for the reply,
Here is how the workflow goes.
We have multiple user tasks which can activate an external task which send email.
Depending upon which user task has activated the external task, the email message to be sent is determined.
What can be a better way to achieve this ?
Regards
Milind
ISCBorisB
You can use "wfvarfinishop" attribute of the user/group tasks to set the callback value for the
mail (externaltask) script.
There is a thread with good examples by Ghoti, search for "Dynamic Successor".
It is also not such a big deal to find predecessor task from inside your external
task (despite what you've read in this obsolete thread), an issue with it is
that IW Documentation on the dynamic WF Object transitions is lacking and all
this nice code ends up not supported.
Also, next time u may have better response simply by stating your issues (ask a question ? :-)
instead of utilizing smth very old
Hope this helps.
milind
Hiii
Thanks for the help, I will try it out and let you know if any issue .
Regards
Milind