Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Detect Compensation Events #315

Closed
csouchet opened this issue Jun 16, 2020 · 0 comments · Fixed by #675
Closed

[FEAT] Detect Compensation Events #315

csouchet opened this issue Jun 16, 2020 · 0 comments · Fixed by #675
Assignees
Labels
BPMN support Something about the BPMN specification that the lib is already supporting or will support enhancement New feature or request external contribution 👤 Pull requests provided by someone who is not a core maintainer good first issue Good for newcomers hacktoberfest Can be done during the Hacktoberfest
Milestone

Comments

@csouchet
Copy link
Member

csouchet commented Jun 16, 2020

Is your feature request related to a problem? Please describe.
Given a bpmn input source, detect the BPMN Compensation Intermediate Event Attached to an Activity Boundary and Compensation Throwing Event.

Describe the solution you'd like
Manage all Compensation Events declared in the BPMN input source.

Describe alternatives you've considered
N/A

Additional context
The final shape rendering of the Compensation Events won't be done as part of this issue and will be managed later, see #655.

BPMN specification

image

General information

Compensation Events are used in the context of triggering or handling compensation (see page 301 for more details on compensation). There are four variations: a Start Event, both a catch and throw Intermediate Event, and an End Event.

  • The Compensation Start Event MAY NOT be used for a top-level Process.
  • The Compensation Start Event MAY be used for an Event Sub-Process.
  • The catch Compensation Intermediate Event MUST only be attached to the boundary of an Activity and, thus, MAY NOT be used in normal flow.
  • The throw Compensation Intermediate Event MAY be used in normal flow.
  • The Compensation End Event MAY be used within any Sub-Process or Process.

The CompensationEventDefinition element inherits the attributes and model associations of BaseElement
(see Table 8.5) through its relationship to the EventDefinition element (see page 259). Table 10.94 (the following) presents the additional attributes and model associations of the CompensationEventDefinition element.

activityRef : Activity [0..1]

For a Start Event:
This Event “catches” the compensation for an Event Sub-Process. No further
information is REQUIRED. The Event Sub-Process will provide the Id necessary
to match the Compensation Event with the Event that threw the compensation,
or the compensation will have been a broadcast.

For an End Event :
The Activity to be compensated MAY be supplied. If an Activity is not supplied,
then the compensation is broadcast to all completed Activities in the current Sub-
Process (if present), or the entire Process instance (if at the global level).

For an Intermediate Event within normal flow:
The Activity to be compensated MAY be supplied. If an Activity is not supplied,
then the compensation is broadcast to all completed Activities in the current Sub-
Process (if present), or the entire Process instance (if at the global level). This
“throws” the compensation.

For an Intermediate Event attached to the boundary of an Activity:
This Event “catches” the compensation. No further information is REQUIRED. The
Activity the Event is attached to will provide the Id necessary to match the
Compensation Event with the Event that threw the compensation, or the
compensation will have been a broadcast.

waitForCompletion : boolean = true
For a throw Compensation Event, this flag determines whether the throw
Intermediate Event waits for the triggered compensation to complete (the default),
or just triggers the compensation and immediately continues (the BPMN 1.2
behavior).

Boundary Event

The Event will be triggered by a thrown compensation targeting that Activity. When the Event is triggered, the Compensation Activity that is associated to the Event will be performed (see page 301).
Note that the interrupting a non-interrupting aspect of other Events does not apply in the case of a Compensation Event. Compensations can only be triggered after completion of the Activity to which they are attached. Thus they cannot interrupt the Activity.

Boundary Event attributes

Attribute Name Description/Usage
attachedTo: Activity Denotes the Activity that boundary Event is attached to.
cancelActivity : boolean Denotes whether the Activity should be canceled or not, i.e.,
whether the boundary catch Event acts as an Error or an Escalation.

If the Activity is not canceled, multiple instances of that handler can run concurrently.
This attribute cannot be applied to Error Events (where it’s always true), or Compensation Events (where it doesn’t apply).

Compensation End Event

This type of End indicates that compensation is necessary. If an Activity
is identified, and it was successfully completed, then that Activity will be
compensated. The Activity MUST be visible from the Compensation
End Event, i.e., one of the following MUST be true:

  • The Compensation End Event is contained in normal flow at the
    same level of Sub-Process.
  • The Compensation End Event is contained in a Compensation
    Event Sub-Process that is contained in the Sub-Process
    containing the Activity.
  • If no Activity is identified, all successfully completed Activities
    visible from the Compensation End Event are compensated, in
    reverse order of their Sequence Flows. Visible means one of the
    following:
  • The Compensation End Event is contained in normal flow and at
    the same level of Sub-Process as the Activities.
  • The Compensation End Event is contained in a Compensation
    Event Sub-Process that is contained in the Sub-Process
    containing the Activities.

To be compensated, an Activity MUST have a boundary Compensation
Event or contain a Compensation Event Sub-Process .

@csouchet csouchet added enhancement New feature or request BPMN support Something about the BPMN specification that the lib is already supporting or will support labels Jun 16, 2020
@tbouffard tbouffard added the good first issue Good for newcomers label Jul 1, 2020
@tbouffard tbouffard changed the title [FEAT] Display Compensation Intermediate Event Attached to an Activity Boundary [FEAT] Detect Compensation Intermediate Event Attached to an Activity Boundary Aug 3, 2020
@csouchet csouchet added the hacktoberfest Can be done during the Hacktoberfest label Sep 15, 2020
@process-analytics process-analytics deleted a comment from csouchet Sep 24, 2020
@process-analytics process-analytics deleted a comment from csouchet Sep 24, 2020
@tbouffard tbouffard changed the title [FEAT] Detect Compensation Intermediate Event Attached to an Activity Boundary [FEAT] Detect Compensation Events Sep 24, 2020
@csouchet csouchet added the external contribution 👤 Pull requests provided by someone who is not a core maintainer label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BPMN support Something about the BPMN specification that the lib is already supporting or will support enhancement New feature or request external contribution 👤 Pull requests provided by someone who is not a core maintainer good first issue Good for newcomers hacktoberfest Can be done during the Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants