How to modify Bonita timer

1
0
-1

Hi All,

In my Process I have two flows in which one of the flow contains timer. if my timer condition is fulfilled it will wait for some message( TYPE: catch message ). In Second flow i want to update timer of the first flow. --I tried to get activity instance of timer -- successful --Called method isTimer() method on that instance -- return true --But tried to update expiration date with below code -- failed since timer's state while updating time is FINISHED, it gives error as it can updates time only when timer is in ready state.

  1. Calendar cal = Calendar.getInstance();
  2. cal.add(Calendar.DAY_OF_YEAR, 5);
  3.  
  4. log.warn("Step 5 prinitng Timer oject "+ timerInstance.isTimer());
  5. runtimeAPI.updateActivityExpectedEndDate(timerInstance.getUUID(),cal.getTime());

also gone though link Boundry Timer on Service Task above link suggest to use method from runtime api

  1. updateExpirationDate(CatchingEventUUID eventUUID, Date expiration)

But I am not able to get CatchingEventUUID for timer (I don't think timer will have catching event UUID but its worth asking) please let me know if you have solution , awaiting your reply.

Regards, Abhi.

Comments

Submitted by haris.subasic on Tue, 08/12/2014 - 12:00

Please note that the topic you were refering to (Boundry Timer on Service Task) is related to Bonita version 5. It will not help you if you are using Bonita BPM6. Note that if you are trying to update a timer that is already in finished state, it is correct that you wouldn't be able to update it anymore.

Submitted by abhi on Tue, 08/12/2014 - 12:37

do we have any alternative to timer so that i can change the date ?

Submitted by haris.subasic on Tue, 08/12/2014 - 13:48

I am sorry, but I don't think I understood your use case, from the description above. There must be a way to design the process for your needs. I think that a screenshot of your process design would help a lot

Submitted by sehej.2110 on Wed, 08/13/2014 - 15:09

Hi, Both of us are working on the same issue. Please see the below image as I explain the scenarios. Our process is quite similar to this. [[img src="C:\Sehej\OrderProcessFlow.png" alt=orderProcessFlow]]

When an order is placed, order id '1-O1', we have a dispatch date until which order should not be dispatched. Please follow the below scenarios :

1) If the date is in future, example September 1,2014(today is August 13,2014),the order should wait on the timer until the date reaches. Then the order is dispatched. This scenario works perfectly fine.

2) The order is now dispatched, but the user does not like something(i.e. the order is partially fulfilled) and want to amend the order, so 'CatchAmendMsg' flow will execute,'1-O1' will be cancelled and will create order as '1-O2'(** the parent order id should remain same for the complete life cycle of a particular order,1 in this case) .When this order is being processed,the user suddenly decides to amend again, so again 'catchAmendMsg' should execute second time.

The issue here is we have a dispatch date in the amend process as well(user is allowed to change the dispatch date while amending the order), so after the first amend, the order should wait for the dispatch date if its a future date(same as in the parent process flow) before dispatching. This is our first requirement.If dispatch date is not a future date, order should go to 'dispatchAmendOrder' task. Second requirement is, when this first amend is waiting for the dispatch date, the order can be amended second time or more times until it reaches dispatch date.

Note, in these two flows, order payment and OrderComplete should occur only once as in the main process as the parent order no is 1. Also, when we amend '1-O1', it is cancelled and '1-O2' is created, and if again amended,'1-O2' is cancelled and '1-O3' is created and so on.

We have tried using a second timer in the amend flow before 'dispatchOrder' task, but suppose the order is waiting in this second timer, 'wait_for_amend_dispatch_date'(not shown in the image), if the user tries amending the same order again, the amend flow does not execute as expected, as the amend flow cannot catch this amend message because its currently waiting on the timer.

In our process, mainly its a business requirement that the user should be able to change the dispatch date to a future date in case of amend order.

Please let us know if you need any further details.

Submitted by sehej.2110 on Wed, 08/13/2014 - 15:11

I am unable to attach an image in here.

Submitted by haris.subasic on Wed, 08/13/2014 - 15:13

You will have to place your image on an external site and put a link here.

Submitted by abhi on Thu, 08/14/2014 - 06:55

Hi Haris, Please find below image link

OrderProcessFlow

No answers yet.
Testing
Notifications