IT Process Automation

  • 1.  How to monitor IRF process

    Posted Feb 26, 2015 05:20 PM

    I have a workflow that sends out multiple approval tasks in parallel (detached process). I need to watch these for completion and determine an approval/rejection from that response

    Do I use the 'Monitor Process' to do that? I can't seem to figure out what to fill in for the Event name, type, source, destination etc. Is that outlined somewhere? The online help was of little assistance in that regard.



  • 2.  Re: How to monitor IRF process
    Best Answer

    Posted Feb 26, 2015 07:21 PM
      |   view attached

    Hi Greg,

     

    I believe you are talking about the Monitor Event operator. You can certainly use that to "keep track" of your detached processes, but keep in mind that you will need to also include a corresponding Send Event in the detached approval process. Those two operators work in conjunction. The Monitor Event will sit and listen for an event to be sent from a Send Event operator. If the event details match (these are those parameters you were looking at), then the process that is monitoring the event will continue. For some further explanation of those parameters, you can check out the PAM reference guide under Process Control. Below though are some important ones to what you might need:

     

    Event Name- this is a name you define and is used to match the send event with the Monitor Event. On the Monitor event operator, this can be a regular expression so as to be able to match several different event names. This is also the only parameter that is required.

     

    Event Parameters - This is on for the Send Event operator only. This is used to send data between processes. In your case, you could pass through the outcome of the approval (approved/rejected). You could also send the userid of the user who completed the task. When the listener receives the event, this information is stored  in the payload parameter and can be accessed and parsed as needed.

     

    Expire After (sec) - This is on for the Send Event operator only. This sets a time to live for the event to wait until a listener consumes it. The reason its important for you is if you don't set a value, the event only lives for an instant and if your Monitor Event operator is not listening for it at that time, it goes away and the event is missed. You can set this value to be long enough so that the event will still be active after your parent process has processed a previous event.

     

    This might seem a little confusing so I have attached some sample processes that show how this can be done. The Monitor Event process spawns three detached processes then waits for the "Approval Event" to be sent. The detached processes have a user interaction task. When that task is completed, the process sends an "Approval Event" with a payload of the response from the form and the userid of the user who completes the task. The event will live for 60 seconds. The parent process then parses that payload into an array called ApprovalResponses, then waits for the next event. After all three events are received, the parent process completes.

     

    These are for PAM 4.2 by the way. The concepts still apply to previous PAM version but these examples might not import properly.

    Attachment(s)

    zip
    Event Usage.xml.zip   15 KB 1 version


  • 3.  Re: How to monitor IRF process

    Posted Feb 27, 2015 05:17 PM

    Benjamin

    Thanks so much, that got me way down the road. I was missing the send event piece and now I get it. That one's not in any of the samples.

    One follow-on question. Is there a technique to monitor multiple processes spawned by the same detached sub-process?

    I have a loop that spawns 'N' number of approval tasks based on how many approval groups are required for the change order and what I'm finding is that as soon one of them is complete, the workflow moves on.

    I need to wait for ALL the processes to complete before moving on. I tried putting the monitor_event in a loop with a loop count of 'N' but it still went on it's merry way after the first approval event.

    I assume I have to track more specifically than just by Event Name?



  • 4.  Re: How to monitor IRF process

    Posted Feb 28, 2015 03:39 PM
      |   view attached

    The example I provided has the process waiting for all 3 events to complete before continuing on. I did use a reset operator instead of a loop, so I have updated it to use the loop and I am attaching it here. My loop is slightly different than yours though. I have the separate counter that I am using (Process.currentResponse) that keeps track of the index into the ApprovalResponse array. I am using that counter to compare against the number of spawned processes (Process.currentResponse < Process.NumOfDetachedProcs) when checking if I need to continue the loop. This counter (Process.currentResponse) is only incremented when it successfully processes an approval.

     

    One thing I failed to mentioned is you will want to set that Event name to be unique for each process run. I usually add an id number to the end of the event name (in this case maybe the change order number). This stops other processes from picking up the approvals from different tickets. You would need to set this in both the monitoring process and the sub processes. For example, your event name could be: "Approval Event-" + Process.chg_ref_num. This could be whats happening if you are testing several change processes at once with these events. Sorry I wasn't thinking about that before.

     

    If that's not the case, is the loop running through all 'N' iterations and completing or does it complete out after one iteration?

    Attachment(s)

    zip
    Monitor Event.xml.zip   8 KB 1 version