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

Add event type for process instance record #596

Closed
skayliu opened this issue Dec 10, 2022 · 0 comments · Fixed by #597
Closed

Add event type for process instance record #596

skayliu opened this issue Dec 10, 2022 · 0 comments · Fixed by #597
Assignees
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior

Comments

@skayliu
Copy link
Contributor

skayliu commented Dec 10, 2022

Description

Like BpmnElementType, BpmnEventType has been introduced to Zeebe SNAPSHOT for process instance record. so that as a consumer of the record stream, you can distinguish the type of event that is processed.

If we run the process below, when extracting EventType, BpmnElementType, Intent from the record we can get these data.

  <process id="wf" isExecutable="true">
    <startEvent id="startEvent_51f2a990-c9ee-497b-85fa-46a4d3bef871">
      <outgoing>sequenceFlow_9eb0b226-9766-423d-b29d-293f94023741</outgoing>
    </startEvent>
    <subProcess id="subProcess" name="subProcess">
      <incoming>sequenceFlow_9eb0b226-9766-423d-b29d-293f94023741</incoming>
      <startEvent id="startEvent_0404dd68-dcf5-47da-afd1-7edbe7c4be86">
        <outgoing>sequenceFlow_797a6693-e45f-45db-b849-309592a2de94</outgoing>
      </startEvent>
      <endEvent id="throw-error" name="throw-error">
        <incoming>sequenceFlow_797a6693-e45f-45db-b849-309592a2de94</incoming>
        <errorEventDefinition errorRef="error_7db76942-1c3a-463c-a359-ba952a9605c5" id="errorEventDefinition_641c1a15-4cbd-4018-989e-995f52f38931"/>
      </endEvent>
      <sequenceFlow id="sequenceFlow_797a6693-e45f-45db-b849-309592a2de94" sourceRef="startEvent_0404dd68-dcf5-47da-afd1-7edbe7c4be86" targetRef="throw-error"/>
    </subProcess>
    <sequenceFlow id="sequenceFlow_9eb0b226-9766-423d-b29d-293f94023741" sourceRef="startEvent_51f2a990-c9ee-497b-85fa-46a4d3bef871" targetRef="subProcess"/>
    <boundaryEvent attachedToRef="subProcess" id="catch-error" name="catch-error">
      <outgoing>sequenceFlow_46eba105-754c-4457-b5bb-50b55311e791</outgoing>
      <errorEventDefinition errorRef="error_7db76942-1c3a-463c-a359-ba952a9605c5" id="errorEventDefinition_27647191-3506-4b08-90f6-a83ab3ca71b8"/>
    </boundaryEvent>
    <endEvent id="endEvent_b93202fd-d3cc-4495-afa6-9208e5850c7b">
      <incoming>sequenceFlow_46eba105-754c-4457-b5bb-50b55311e791</incoming>
    </endEvent>
    <sequenceFlow id="sequenceFlow_46eba105-754c-4457-b5bb-50b55311e791" sourceRef="catch-error" targetRef="endEvent_b93202fd-d3cc-4495-afa6-9208e5850c7b"/>
  </process>
  <error errorCode="ERROR" id="error_7db76942-1c3a-463c-a359-ba952a9605c5"/>

[(UNSPECIFIED, PROCESS, ELEMENT_ACTIVATING),
    (UNSPECIFIED, PROCESS, ELEMENT_ACTIVATED),
    (NONE, START_EVENT, ELEMENT_ACTIVATING),
    (NONE, START_EVENT, ELEMENT_ACTIVATED),
    (NONE, START_EVENT, ELEMENT_COMPLETING),
    (NONE, START_EVENT, ELEMENT_COMPLETED),
    (UNSPECIFIED, SEQUENCE_FLOW, SEQUENCE_FLOW_TAKEN),
    (UNSPECIFIED, SUB_PROCESS, ELEMENT_ACTIVATING),
    (UNSPECIFIED, SUB_PROCESS, ELEMENT_ACTIVATED),
    (NONE, START_EVENT, ELEMENT_ACTIVATING),
    (NONE, START_EVENT, ELEMENT_ACTIVATED),
    (NONE, START_EVENT, ELEMENT_COMPLETING),
    (NONE, START_EVENT, ELEMENT_COMPLETED),
    (UNSPECIFIED, SEQUENCE_FLOW, SEQUENCE_FLOW_TAKEN),
    (ERROR, END_EVENT, ELEMENT_ACTIVATING),
    (ERROR, END_EVENT, ELEMENT_ACTIVATED),
    (UNSPECIFIED, SUB_PROCESS, ELEMENT_TERMINATING),
    (ERROR, END_EVENT, ELEMENT_TERMINATING),
    (ERROR, END_EVENT, ELEMENT_TERMINATED),
    (UNSPECIFIED, SUB_PROCESS, ELEMENT_TERMINATED),
    (ERROR, BOUNDARY_EVENT, ELEMENT_ACTIVATING),
    (ERROR, BOUNDARY_EVENT, ELEMENT_ACTIVATED),
    (ERROR, BOUNDARY_EVENT, ELEMENT_COMPLETING),
    (ERROR, BOUNDARY_EVENT, ELEMENT_COMPLETED),
    (UNSPECIFIED, SEQUENCE_FLOW, SEQUENCE_FLOW_TAKEN),
    (NONE, END_EVENT, ELEMENT_ACTIVATING),
    (NONE, END_EVENT, ELEMENT_ACTIVATED),
    (NONE, END_EVENT, ELEMENT_COMPLETING),
    (NONE, END_EVENT, ELEMENT_COMPLETED),
    (UNSPECIFIED, PROCESS, ELEMENT_COMPLETING),
    (UNSPECIFIED, PROCESS, ELEMENT_COMPLETED)]

@skayliu skayliu added the kind/feature Categorizes an issue or PR as a feature, i.e. new behavior label Dec 10, 2022
@remcowesterhoud remcowesterhoud self-assigned this Dec 13, 2022
ghost pushed a commit that referenced this issue Dec 13, 2022
597: feat(filters): add event type for process instance record r=remcowesterhoud a=skayliu

## Description

Like `BpmnElementType`, `BpmnEventType` has been introduced to Zeebe SNAPSHOT for process instance record. so that as a consumer of the record stream, you can distinguish the type of event that is processed.


## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #596 

<!-- Cut-off marker
_All lines under and including the cut-off marker will be removed from the merge commit message_

## Definition of Ready

Please check the items that apply, before requesting a review.

You can find more details about these items in our wiki page about [Pull Requests and Code Reviews](https://github.com/camunda-cloud/zeebe/wiki/Pull-Requests-and-Code-Reviews).

* [ ] I've reviewed my own code
* [ ] I've written a clear changelist description
* [ ] I've narrowly scoped my changes
* [ ] I've separated structural from behavioural changes
-->

## Definition of Done

<!-- Please check the items that apply, before merging or (if possible) before requesting a review. -->

_Not all items need to be done depending on the issue and the pull request._

Code changes:
* [ ] The changes are backwards compatibility with previous versions
* [ ] If it fixes a bug then PRs are created to backport the fix

Testing:
* [x] There are unit/integration tests that verify all acceptance criterias of the issue
* [ ] New tests are written to ensure backwards compatibility with further versions
* [x] The behavior is tested manually

Documentation:
* [ ] Javadoc has been written
* [ ] The documentation is updated


Co-authored-by: skayliu <skay463@163.com>
@ghost ghost closed this as completed in 9badb55 Dec 13, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants