Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Working with Monitoring process : External event operations : Workstep activation and completion
 

Workstep activation and completion

The external events supported for workstep are - external ACTIVATE_WORKSTEP event and external COMPLETE_WORKSTEP event. Business Process Server reads the following data from this event associated with the workstep.
*Deriving start time — BP Server uses the start time from the external ACTIVATE_WORKSTEP event. If ACTIVATE_WORKSTEP event does not contain start time, then event creation time is taken as the start time. However, if only COMPLETE_WORKSTEP event is received, then it reads the start time from the external COMPLETE_WORKSTEP event. If ACTIVATE_WORKSTEP event is not received and start time is not available in the COMPLETE_WORKSTEP event, then BP Server derives it using the following logic:
*If the COMPLETE_WORKSTEP event contains completion time and duration, then the start time is "end time - duration".
*If the COMPLETE_WORKSTEP event contains end time, but does not contain duration, then the start time is "end time - estimated duration".
*If the COMPLETE_WORKSTEP event does not contain end time and duration, then end event create time is considered as the end time. Therefore, the start time is "end time - estimated duration".
*Deriving End time — The end time is taken only from the COMPLETE_WORKSTEP event; if it is specified in the ACTIVATE_WORKSTEP event, then BP Server ignores it. If the end time is not specified in the event, then BP Server derives it using the following logic:
*If the ACTIVATE_WORKSTEP event contains start time, and COMPLETE_WORKSTEP event contains duration, then end time is "start time + duration".
*If the ACTIVATE_WORKSTEP event contains start time, but duration is not provided in the COMPLETE_WORKSTEP event, then end time is "start time + estimated duration".
*If ACTIVATE_WORKSTEP event does not contain the start time, and COMPLETE_WORKSTEP event does not contain the end time and duration, then COMPLETE_WORKSTEP event create time is considered as the end time.
*Deriving Duration — If the duration (in seconds) is provided in the COMPLETE_WORKSTEP event, then it takes precedence over the calculated value (workstep end time - workstep start time). If the provided duration is greater than the calculated value, then BP Server logs a warning in the log file and uses the provided duration. If the event does not contain start time, end time, and duration, then Business Process Server's workstep estimated duration is considered as the duration.
*Performer — The performer is mandatory for human worksteps. The performer need not be a Business Process Server user. For a monitoring human workstep, application developer can specify a single user or a mapped dataslot as the "default performer" while designing a process. If the external ACTIVATE_WORKSTEP event for human workstep does not contain performer, then default performer is used. If the default performer is invalid, then the Business Process Server user specified during Business Process Server installation is used.
*Loop counter — If the monitoring workstep is executed within a loop construct, then the external application needs to provide the loop counter as part of workstep events to handle out-of-sequence events. Without the loop counter, BP Server may not be able to process the events of a workstep in a loop. The loop counter starts from 1.
*Dataslots — For an external workstep event (ACTIVATE_WORKSTEP or COMPLETE_WORKSTEP), BP Server processes only the dataslots defined in that workstep, it ignores the remaining dataslots. For the list of supported dataslots, refer to Dataslot update. If EIId dataslot is passed as part of dataslots, then BP Server ignores it and adds a warning in the log.