Topic
23 replies Latest Post - ‏2013-02-04T06:17:34Z by SystemAdmin
SystemAdmin
SystemAdmin
7615 Posts
ACCEPTED ANSWER

Pinned topic re:cancel the process based on due date

‏2013-01-28T06:45:17Z |
Hi,

I want to stop the proceess instance if due date of the process exceeds ?

how should i implement this?

thanks.
Updated on 2013-02-04T06:17:34Z at 2013-02-04T06:17:34Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-28T08:48:47Z  in response to SystemAdmin
    Hi ,

    any help?
    its urgent...

    thanks.
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-28T11:57:19Z  in response to SystemAdmin
    Hi,

    As I understood you need to cancel a process based on a due date of a task, right?

    If this is the case, you could attach a timer to that task to be trigered after the due date. The flow of this timer would go to the end of the process.
    Don´t forget to ´check´ the "Interrupt Activity" feature in the timer.

    I hope this helps you.

    Regards,
    J
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: re:cancel the process based on due date

      ‏2013-01-28T12:50:28Z  in response to SystemAdmin
      Hi thanks for u reply

      u r understanding is correct .
      but "you could attach a timer to that task to be trigered after the due date" how can i know that activity is going to perform after DUE DATE?

      y becoz all acyivities may perform with in the due date date also.

      if i am worng plz clarify me

      thanks.
      • SystemAdmin
        SystemAdmin
        7615 Posts
        ACCEPTED ANSWER

        Re: re:cancel the process based on due date

        ‏2013-01-28T12:53:12Z  in response to SystemAdmin
        sorry
        The due date iam saying is for entire process .If the process exceeds the duedate then it should be cancelled.

        thanks
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-28T12:57:06Z  in response to SystemAdmin
    Ok, so you have a due date for the process itself and I was thinking about the due date that each task have.

    You have that due date defined in a variable, right?

    Regards,
    J
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: re:cancel the process based on due date

      ‏2013-01-28T13:14:13Z  in response to SystemAdmin
      Hi thanks again
      Yes i defined in a twdate variable.

      thanks
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-28T13:21:08Z  in response to SystemAdmin
    I am sure that there are more ways to do this...
    But for example: You could put a Timer Intermediate Event (don't attach it to any activity) in your process to be triggered "After Custom Date" and in the custom date field you can put your date var.
    Then the flow should go to a System Activity to cancel the process and here you could use the API to cancel it and then the connected to the end.

    Ex: tw.system.findProcessInstanceById(tw.system.currentProcessInstanceID).abort()

    This was clear for you?

    I think this should work.

    Regards,
    J
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-28T16:05:20Z  in response to SystemAdmin
    Probably you cannot bind your date variable directly in the input field of the timer... I dont know...
    Tomorrow when I get to the office I will try that and then I will post again.

    Regards,
    J
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-29T07:41:21Z  in response to SystemAdmin
    Hi Lahari,

    I am sorry, I was not able to test because I am really busy right now.
    In the meanwhile you could try the first approach that I gave you, each step of your process could have a timer attach to it and in the custom time (trigger after custom date) you could put your Due Date of the process.

    Check which format you have to put in Custom Date. String? Format? You have that info in docs.

    As soon is possible for me I will try to test this.

    Regards,
    J
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: re:cancel the process based on due date

      ‏2013-01-29T18:44:01Z  in response to SystemAdmin
      Hi thanks

      1st case wont work for me i think.

      i check the date format of duedate and my customdate both r in same format , but still its not working

      thanks
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-29T18:42:09Z  in response to SystemAdmin
    Hi all,

    any other help?

    thanks.
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-30T07:59:33Z  in response to SystemAdmin
    Hi Lahari,

    I had the opportunity to test what I've suggested to you and it really works.

    I will explain the details again and if you have any question please ask!

    1 - I created a process with two human tasks in a user lane with a timer event attached to each item.
    2 - The timer event (Timer intermediate Event) has the following configuration: Interrupt Activity? checked, Trigger On: After Custom Date, Custom Date: private variable of type Date.
    2 - All the timer events have a flow connected to a script in system lane that has the following code: tw.system.findProcessInstanceById(tw.system.currentProcessInstance.id)).abort(); (basically he is getting the current process and cancel it as you specified!)
    3 - This script is connected to the end point.

    Then I started the process and when the token was in one of the tasks and timer fired (when the due date defined by was reached) the process was canceled.

    I tried give you all details and I hope this helps you.

    Regards,
    J
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: re:cancel the process based on due date

      ‏2013-01-30T08:27:54Z  in response to SystemAdmin
      hi

      thanks but i hav more almost 10 human activities in about 6 lanes .

      then i need to place timer events to all activities ?

      is it correct way hav all timer events for 10 activities.

      thanks again for u help
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-30T10:27:19Z  in response to SystemAdmin
    Hi,

    I don't see any reason to don´t do it...

    Put a timer in each activity as I explaned in the last post.
    When a token is in an activity, there is a token for the timer as well, and when the timer custom due date is reached the timer is triggered, the human activity is canceled (Interrupt Activity checked) and flow goes to the script that will cancel the process!

    It was clear for you?

    Regards,
    J
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: re:cancel the process based on due date

      ‏2013-01-30T17:33:38Z  in response to SystemAdmin
      A few points -

      1. If you just route the timers to an "terminate" end point, it behaves like the abort JS call. (Note a bug for the terminate has been reported on the forumn when a token is waiting on a join)
      2. Assuming the end date is global, you don't need to do this to every activity, use a wrapper.

      What does the 2nd point mean? Well, assume I had a really complex BPD with 100s of activities. And assume I wanted to terminate the BPD after 7 days no matter what was going on. I could put the logic on every activity. The problem here is this makes the diagram really really hard to read (well, I should say harder, if there are 100s of activities). Additionally I have to make sure to go and do it on every new activity. What a pain! So, how can I solve it.

      Simple. Assume the BPD above is called "Main". Create a new BPD called "Wrapper". It has only one activity in it. That activity is the BPD "Main". Now if I put a timer on that activity in the wrapper BPD, set the timer value, and route the timer token to a "Terminate" end point, then no matter what is going on in the "Main" BPD, when the timer fires the BPD instance ends.

      Bing, Bang, Boom, done. Adding one layer of abstaction can sometimes make your life much much easier.

      Andrew Paier | Director of Special Operations | BP3 Global, Inc. www.bp-3.com
      • SystemAdmin
        SystemAdmin
        7615 Posts
        ACCEPTED ANSWER

        Re: re:cancel the process based on due date

        ‏2013-01-30T18:41:48Z  in response to SystemAdmin
        Hi AndrewPaier ,

        Thanks let me try and get back to u . i hope it will work.
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: re:cancel the process based on due date

      ‏2013-01-30T18:40:34Z  in response to SystemAdmin
      hi jmlbv,

      thanks for the support that u have gave

      Thanks a lot.
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: re:cancel the process based on due date

    ‏2013-01-31T05:37:53Z  in response to SystemAdmin
    Hi Lahari,

    If you need more help just ask!

    Reagards,
    J
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: re:cancel the process based on due date

      ‏2013-02-03T18:05:12Z  in response to SystemAdmin
      Hi jmlbv ,

      I resolved my previous issue of canceling the procees thanks.

      can u plz help on my post http://www.ibm.com/developerworks/forums/thread.jspa?threadID=470034&tstart=0
      • SystemAdmin
        SystemAdmin
        7615 Posts
        ACCEPTED ANSWER

        Re: re:cancel the process based on due date

        ‏2013-02-04T05:37:53Z  in response to SystemAdmin
        Hi,

        Good!

        I will take a look as soon as possible for me!

        Regards,
        J
        • SystemAdmin
          SystemAdmin
          7615 Posts
          ACCEPTED ANSWER

          Re: re:cancel the process based on due date

          ‏2013-02-04T06:17:34Z  in response to SystemAdmin
          Don't forget to mark this post as "Answered"!

          Regards,
          J