Activity processing is organized in two activations. The first activation
sets up the environment. The second activation starts when a defined
external interaction occurs.
About this task
To set up the environment to enable the second activation
to take place, the first activation must:
- Define an input event that depicts the external interaction. The
activity cannot now complete until this input event has been dealt
with.
- Obtain an activity identifier that uniquely identifies
this activity-instance. To do this, it issues an ASSIGN command.
The
transaction that starts the second activation must use this identifier
to gain access to the activity.
- Save details of the activity identifier and input event to a suitable
medium. For example, a VSAM file or WebSphere MQ queue, to which the
transaction that starts the second activation has access.
- Return without completing. (That is, issue an EXEC CICS® RETURN
command on which the ENDACTIVITY option is omitted. Because of the
user event in its event pool—the input event that it has defined—the
activity does not complete but becomes dormant.)
When the external interaction occurs—for example, a clerk
enters some data at a terminal—the transaction that starts the second
activation of the activity is invoked. This transaction must:
- Retrieve the activity identifier and input event
- Gain access to the activity by issuing an ACQUIRE ACTIVITYID command
that specifies the activity identifier.
- Reactivate the activity, and specify why it is being activated
by issuing a RUN ACQACTIVITY command that specifies the input event.
Figure 1 shows an activity
that interacts with the outside world. The first activation sets up
the environment, saves details of the activity identifier and input
event to a VSAM file, and returns without completing. Some time later,
a user starts the SPAR transaction from a terminal. The SPAR transaction
retrieves the activity identifier and input event, issues an ACQUIRE
ACTIVITYID command to gain access to the activity, supplies the activity
with some input data, and reactivates it.
Figure 1. Acquiring
an activity.
On its initial activation, the activity sets
up the environment and returns without completing. Some time later,
the SPAR transaction is started from a terminal; it retrieves the
activity identifier and input event, issues an ACQUIRE ACTIVITYID
command to gain access to the activity, and reactivates it.