Topic
  • 6 replies
  • Latest Post - ‏2012-06-29T14:13:46Z by AnthonyBpm
Jumbo123
Jumbo123
33 Posts

Pinned topic is it possible to have different timer properties for each task in the loop

‏2012-06-27T19:22:54Z |
Hi Folks,

I am modelling a BPD where i have a multiinstance looping on an activity step. I do have a timer event attached to it. My requirement is to have different timer firing properties for each parallel task of that activity in the loop. Is this possible to achieve in IBM BPM? or is there any other way to model this?
Thanks,
KK
Updated on 2012-06-29T14:13:46Z at 2012-06-29T14:13:46Z by AnthonyBpm
  • kolban
    kolban
    3316 Posts

    Re: is it possible to have different timer properties for each task in the loop

    ‏2012-06-27T21:41:44Z  
    Hi there KK,
    Can you help me understand a little more about what you are looking for?

    I can imagine a number of different stories at play here ...

    1. I want a single timer to fire if all of the looped activities haven't completed in time

    2. I want multiple timers to fire for each of the looped activities that haven't completed in time

    but your question talked about "timer firing properties" which makes me feel that there is some other aspect to the story. What properties are you thinking off?

    Neil
  • Jumbo123
    Jumbo123
    33 Posts

    Re: is it possible to have different timer properties for each task in the loop

    ‏2012-06-28T02:41:02Z  
    • kolban
    • ‏2012-06-27T21:41:44Z
    Hi there KK,
    Can you help me understand a little more about what you are looking for?

    I can imagine a number of different stories at play here ...

    1. I want a single timer to fire if all of the looped activities haven't completed in time

    2. I want multiple timers to fire for each of the looped activities that haven't completed in time

    but your question talked about "timer firing properties" which makes me feel that there is some other aspect to the story. What properties are you thinking off?

    Neil
    Hi Neil,

    I have scenario as below.

    1. I want a *bold*single timer to fire if *bold*each of the looped activities haven't completed in time.

    Lets's say , I have an activity A which has three(can be more) runtime instances which are P,Q,R.The timer instance for P should fire at 1 hour after start of step.The timer instance for Q should fire at 2 hour after start of step.The timer instance for R should fire at 3 hour after start of step.

    After trying, what i could find is that timer is associated with the looped activity , not to the each instance of that looped activity.Only single token is generated for the timer, not three.

    Thanks,
    KK
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: is it possible to have different timer properties for each task in the loop

    ‏2012-06-28T13:49:42Z  
    If you implement the MIL as a service and attach the timer to the activity, then there is only one timer and therefore only one timer setting. So only one duration, and any actions (such as close task) would affect the entire activity and not just any individual tasks.

    So, to do what you'd want, you'd have to implement the MIL as a nested process. Then in the nested process attach a timer to your activity. That one you get one timer token per task, each with its own settings. (Standard cautions about nested processes in a MIL apply. In short, make sure that your first activity is a human task. Also, in this case, it would be good to ensure that all of the timers are not the same duration. A large number of timers firing all for the same BPD might cause locking issues depending on how many timers there are and what was being triggered as part of the timers.)

    David
  • AnthonyBpm
    AnthonyBpm
    390 Posts

    Re: is it possible to have different timer properties for each task in the loop

    ‏2012-06-28T16:11:06Z  
    If you implement the MIL as a service and attach the timer to the activity, then there is only one timer and therefore only one timer setting. So only one duration, and any actions (such as close task) would affect the entire activity and not just any individual tasks.

    So, to do what you'd want, you'd have to implement the MIL as a nested process. Then in the nested process attach a timer to your activity. That one you get one timer token per task, each with its own settings. (Standard cautions about nested processes in a MIL apply. In short, make sure that your first activity is a human task. Also, in this case, it would be good to ensure that all of the timers are not the same duration. A large number of timers firing all for the same BPD might cause locking issues depending on how many timers there are and what was being triggered as part of the timers.)

    David
    With regard to the MIL as a service, you can still customize the date or interval for the timer by information in a list. That list would be referenced by the MIL step's counter. So lets say you have a list of integers that corresponds to the MIL task being created {1,2,3,4} and is named tw.local.myInts. You can specify tw.local.myIntshttp://tw.system.step.counter as the value for the Before/After difference; the same applies with a list of Dates and the custom date field. You can even specify functions within those blocks, whether thy are in line or call a server-side JavaScript function that you've included in your Managed Files.

    There's also some complimentary discussion on what David's talking about in terms of handling timers when you need to worry about performance in the wiki article Fire Event on Task Assignment.

    HTH
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: is it possible to have different timer properties for each task in the loop

    ‏2012-06-28T19:49:53Z  
    With regard to the MIL as a service, you can still customize the date or interval for the timer by information in a list. That list would be referenced by the MIL step's counter. So lets say you have a list of integers that corresponds to the MIL task being created {1,2,3,4} and is named tw.local.myInts. You can specify tw.local.myIntshttp://tw.system.step.counter as the value for the Before/After difference; the same applies with a list of Dates and the custom date field. You can even specify functions within those blocks, whether thy are in line or call a server-side JavaScript function that you've included in your Managed Files.

    There's also some complimentary discussion on what David's talking about in terms of handling timers when you need to worry about performance in the wiki article Fire Event on Task Assignment.

    HTH
    No, you can't use tw.system.step.counter. ( When you posted this suggestion, I went back to create a test case to make sure I'm right on this. I was hoping I was wrong because this would have been a nicer solution.)

    The problem is that, as I said, there's only one timer token. You can only use step.counter in things that are going to execute per each loop, like data mapping or task subject. The timer can only have one value, so trying to use step.counter won't work.

    David
  • AnthonyBpm
    AnthonyBpm
    390 Posts

    Re: is it possible to have different timer properties for each task in the loop

    ‏2012-06-29T14:13:46Z  
    No, you can't use tw.system.step.counter. ( When you posted this suggestion, I went back to create a test case to make sure I'm right on this. I was hoping I was wrong because this would have been a nicer solution.)

    The problem is that, as I said, there's only one timer token. You can only use step.counter in things that are going to execute per each loop, like data mapping or task subject. The timer can only have one value, so trying to use step.counter won't work.

    David
    Well that's disappointing and surprising. That was awesome of you to verify and that is something I should have done to begin with. I just assumed that the token would act for each task that was spawned. You know what happens when you assume......