Resetting and deleting reattachment events
Retrieving an atomic event (but not a composite event) from the reattachment queue automatically causes the event's fire status to be reset to NOTFIRED. You can follow this sequence that an activity might use to handle reattachment events.
About this task
Retrieving a composite event from the reattachment queue does not reset the event's fire status to NOTFIRED, because a composite event is only reset when its predicate becomes false. Thus, if an activity program retrieves a composite event, it should reset the fire status of the sub-event or sub-events that have fired. (One way of doing this is to issue one or more RETRIEVE SUBEVENT commands.) This in turn causes the fire status of the composite event to be re-evaluated.
If the activity was reattached because of the completion of one of its children, it should issue a CHECK ACTIVITY command to check whether the child activity completed normally. On return from the CHECK ACTIVITY command, CICS deletes the activity completion event from the parent's event pool.
If the activity was reattached because of the expiry of a timer, it can issue a CHECK TIMER command to check whether the timer expired normally. On return from the CHECK TIMER command, CICS deletes the timer event from the activity's event pool.
If the activity wants to delete input and composite events from its event pool, it can issue DELETE EVENT commands. Alternatively, it can rely on a RETURN ENDACTIVITY command, issued on its final activation, to delete them.
Figure 1
shows a typical
sequence that an activity might use to handle reattachment events.
The
Handle atomic event
box is expanded in
Figure 2.
Handle atomic eventbox is expanded in Figure 2 . The figure shows multiple reattachment events being handled in a single activation—you may prefer to handle one per activation.


- Figure 1 shows multiple reattachment events being handled in a single activation. This may not always be appropriate. You may want always to retrieve only one reattachment event per activation, even if there is more than one event on the reattachment queue. This could be the case if, for example, you want a syncpoint to be taken between each processing step. (Note especially that a child activity that is run asynchronously is not started until a syncpoint occurs when its parent returns. Dealing with many reattachment events in the same activation could delay the start of the child.)
- The figures show input and composite events being explicitly deleted by means of DELETE EVENT commands. This is not always strictly necessary—see Using the ENDACTIVITY option of the RETURN command . Similarly, it may not always be necessary to issue CHECK TIMER commands. If you don't, timer events can be deleted by means of a RETURN ENDACTIVITY command issued on the activity's final activation.