Activity Sequence Reversal Process
OIPA supports reverse / reapply of activities spawned using Activity Sequence. With Activity Sequence Reversal, the user can shadow/reverse the entire sequence in the opposite order in which they were first executed (last processed = first reversed), same as Spawn Reversals. The reverse/reapply process support activities that are created.
- within the same object level (e.g. Client)
- across object levels (e.g. Client to Policy)
Steps of Activity Sequence Task Processing
The system performs Activity Sequence Task Processing in the following steps:
- System checks if activity is in 'Activity Sequence Pending (70)' state or not. If it is (70), initiates activity sequence task processing.
- If activity sequence task is in Pending - 02 status:
- System loads the activity sequence list by task GUID. If it is not empty, system goes to process them one by one in the order of sequence number.
- System gets an activity sequence based on current sequence number to process and checks its direction whether it is 'Forward Activity Sequence Flow' or 'Reverse Activity Sequence Flow'. This process is repeated for each sequence.
- When it is done with all sequences processed successfully, system sets the activity sequence task status to 'Process Activity Sequence(03)'.
- If activity sequence task is in 'Process Activity Sequence(03)' status, system sets the activity sequence task status to Complete(01) and updates the activity status with completion status code of sequence task.
- If activity sequence exception is thrown in this process, System sets the activity sequence task status to 'Sequence Error(98)'.
- If any other exception is occurred in this process, System sets the activity sequence task status to 'System Error(99)'.
- If activity sequence task status is in 01 (Complete), activity status is updated with completion status code of sequence task, else it is updated with 'Activity Sequence Error(72)' status.
Steps of Reverse Activity Sequence Flow
- System loads the activity sequence detail list and status of all its activities.
- If activity is in "Pending(02)" status, it is shadowed. If activity is not in "Pending(02)" status i.e. if it is "Active", it creates Activity Sequence Reversal (type code=05) for this activity. and then processes the Activity Sequence Reversal. With Activity Sequence reversal, the entire sequence is shadowed/reversed in the opposite order in which they were first executed (i.e. last processed = first reversed).
Example
When an activity A with an activity sequence task having two activity sequences AS1 and AS2 with A1 and A2 being the activities under sequence AS1, and B1 and B2 being the activities under sequence AS2. Assuming that the PROCESSIMMEDIATE attribute is set to "Yes" for both the sequences, the activities will be processed in the order A1, A2, B1, B2 according to the forward activity sequence flow. In case of the Reverse Activity Sequence Flow, the order of reversal will be B2, B1, A2, A1 which is exactly in the opposite order of the forward activity sequence flow.
- System checks, if f there is any Sequence Reversal Activity that exists with "Pending(02)" status, if "Yes", then it will throw an activity sequence error. If "No", then it will increase the current sequence number by 1 for activity sequence task and picks up the next sequence.
The pending activities on the entity are processed based on another new attribute which is added to the Activity Sequence Reversal called the "PROCESSALLAFTERREVERSAL".
This attribute makes this a configurable task, which helps to decide whether or not the pending activities need to be processed after the reversal has been carried out based on the value which has been assigned to this attribute in the configuration. If the value of the attribute PROCESSALLAFTERREVERSAL has been set to "No" in the configuration, then all the pending activities will not be processed after the reversal has been carried out, else if the value of the attribute PROCESSALLAFTERREVERSAL has not been set, it will consider the value to be "Yes" by default; or if it has been set to "Yes", then it will process all the pending activities after the reversal.
When reversing any activity, the Transaction code of the below will be taken into account:
A Regular transaction – the activity can be reversed and will cause any subsequent activities to also be reversed.
A Reversible-Non-Reversing transaction – the activity can be reversed but any subsequent activities will not be reversed.
A Nonreversible-Nonreversing transaction - the activity cannot be reversed and any subsequent activities will not be reversed.
Process Flow
XML Schema
<Transaction Name=“A”>
<Math>
</Math>
<ActivitySequenceProcess>
<ActivitySequence Name=“AS1” PROCESSALLAFTERREVERSAL="No">
<Activity PROCESSIMMEDIATE="Yes">[A1, A2]</Activity>
</ActivitySequence>
<ActivitySequence Name=“AS2” PROCESSALLAFTERREVERSAL="Yes">
<Activity PROCESSIMMEDIATE="Yes">[B1, B2]</Activity>
</ActivitySequence>
<ActivitySequence Name=“AS3” PROCESSALLAFTERREVERSAL="No">
<Activity PROCESSIMMEDIATE="Yes">[C1, C2]</Activity>
</ActivitySequence>
</ActivitySequenceProcess>
</Transaction>