Taskids always in order?

Options
Hi,
When a workflow gets instantiated at that time only all the taskids are generated.
I have generally seen that taskids are always created in order. So is it true?
I don't see this documented anywhere...
e.g
1234---jobid
1235---task 1
1236---task 2
1237---task 3
1238---task 4

Comments

  • The task ID increments as a task is instantiated. However if a job loops, say through a rejected approval step, the taskids will be reused, thus you can have tasks 1111, 1112, 1113, 1114, 1112, 1113, 1114, 1115.... etc
  • The task ID increments as a task is instantiated. However if a job loops, say through a rejected approval step, the taskids will be reused, thus you can have tasks 1111, 1112, 1113, 1114, 1112, 1113, 1114, 1115.... etc
    In addition - if you use TeamSite::WFconstructor and/or WFM - the order in which the tasks get defined in the generated job specification file determines the sequential numbering - and that's not always the same order that you think about the workflow process -- in general - don't assume anything about taskid values - only that if the system hands it to you it can be used to reference a specific task.
  • Oh ok...thanks for this info....
    Now consider this situation:
    ---Start Task---
    --Author---
    --Group Task---(review task)
    --Email---
    --Submit/Author(depending upon approve or reject of Grouptask)


    Now in email task..i want to send email to author/All(on reject or approve resp)
    Now in this email from:"owner of Group task"...
    Now since this is group task..Owner of this task is decided dynamically...
    (If this wuld have been user task than it is simple..)..So i my email task i want the taskid of previous task and from which i can create task obj..and can get its task owner...
    So if suppose taskids wuld have been i order this wuld be easy..currenttaskid - 1...
    So now since this is not the case..how can we solve this problem...
    I think we can solve this by..."gettaskbyname"...
    But suppose i dont want to do that...because m using the...(header tpl...at many places...)....
    So any suggestions for this case.....
  • Oh ok...thanks for this info....
    Now consider this situation:
    ---Start Task---
    --Author---
    --Group Task---(review task)
    --Email---
    --Submit/Author(depending upon approve or reject of Grouptask)


    Now in email task..i want to send email to author/All(on reject or approve resp)
    Now in this email from:"owner of Group task"...
    Now since this is group task..Owner of this task is decided dynamically...
    (If this wuld have been user task than it is simple..)..So i my email task i want the taskid of previous task and from which i can create task obj..and can get its task owner...
    So if suppose taskids wuld have been i order this wuld be easy..currenttaskid - 1...
    So now since this is not the case..how can we solve this problem...
    I think we can solve this by..."gettaskbyname"...
    But suppose i dont want to do that...because m using the...(header tpl...at many places...)....
    So any suggestions for this case.....
    Hi. You can use GetActivationTime() function to get the activation time for all the workflow tasks. Then you can check for the difference between the activation time and the current time. So the task which has the minimum time difference will be the most recent task. You can find GetActivationTime() function under the TeamSite::WFtask module.
    Hope that will help you. :-)

    Thanks
    Akshat Agarwal
  • Oh ok...thanks for this info....
    Now consider this situation:
    ---Start Task---
    --Author---
    --Group Task---(review task)
    --Email---
    --Submit/Author(depending upon approve or reject of Grouptask)


    Now in email task..i want to send email to author/All(on reject or approve resp)
    Now in this email from:"owner of Group task"...
    Now since this is group task..Owner of this task is decided dynamically...
    (If this wuld have been user task than it is simple..)..So i my email task i want the taskid of previous task and from which i can create task obj..and can get its task owner...
    So if suppose taskids wuld have been i order this wuld be easy..currenttaskid - 1...
    So now since this is not the case..how can we solve this problem...
    I think we can solve this by..."gettaskbyname"...
    But suppose i dont want to do that...because m using the...(header tpl...at many places...)....
    So any suggestions for this case.....
    Have your script take additional parameters (the names of tasks you want to reference for additional information) and then use getTaskByName to obtain task objects for those named tasks.
    This would allow you to use the same script in multiple workflows - and is fully supported.
    Assuming taskids as sequential to your specific process flow is not supported.
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs