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

Migrate interrupting event sub marker #6813

Merged
2 commits merged into from
Apr 19, 2021
Merged

Conversation

Zelldon
Copy link
Member

@Zelldon Zelldon commented Apr 17, 2021

Description

  • Moves the event sub process interruption marker to related EventAppliers, in order to have no longer state changes in the processing (updating the flow scope element instance).
  • The logic of marking the flow scope is encapsulated by a helper class
  • The interruption marker is changed from the element instance key to the corresponding element id, since this the available information we have in the applier. This change allows to migrate the event sub processes.
  • Some unused code is removed

Who ever has time first @npepinpe @saig0 We need that for continuing on migration of event and embedded sub process

Related issues

related #6195
related #6196

Definition of Done

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 to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/0.25) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement

@Zelldon Zelldon requested review from npepinpe and saig0 April 17, 2021 11:21
@Zelldon Zelldon changed the title Migrate interrupting event sub Migrate interrupting event sub marker Apr 17, 2021
@Zelldon
Copy link
Member Author

Zelldon commented Apr 17, 2021

Hey @saig0 I need your help here. I migrated the interrupting marker from element instance key to element id, this was something we discussed some weeks ago. This is necessary for migrating the event sub processes and to avoid state changes on the event triggering.

My current issue is one failing test, which expects a incident instead of a rejection. I'm not sure whether it would be also fine to just have the rejection instead.

The test in question is ErrorEventIncidentTest#shouldCreateIncidentWithDefaultErrorMessage

Related LOG
13:17:38.424 [Broker-0-StreamProcessor-1] INFO  org.camunda.feel.FeelEngine - Engine created. [value-mapper: CompositeValueMapper(List(io.zeebe.el.impl.feel.MessagePackValueMapper@138e3396)), function-provider: io.zeebe.el.impl.feel.FeelFunctionProvider@5253c1f9, clock: io.zeebe.el.impl.ZeebeFeelEngineClock@28137647, configuration: Configuration(false)]
13:17:43.437 [] INFO  io.zeebe.test - Test failed, following records were exported:
13:17:43.493 [] INFO  io.zeebe.test - Compact log representation:
--------
	['C'ommand/'E'event/'R'ejection] [valueType] [intent] - #[position]->#[source record position]  P[partitionId]K[key] - [summary of value]
	P9K999 - key; #999 - record position; "ID" element/process id; @"elementid"/[P9K999] - element with ID and key
	Keys are decomposed into partition id and per partition key (e.g. 2251799813685253 -> P1K005). If single partition, the partition is omitted.
	Long IDs are shortened (e.g. 'startEvent_5d56488e-0570-416c-ba2d-36d2a3acea78' -> 'star..acea78'
--------
C DEPLOYMENT         CREATE         - #01-> -1  -1 - process.xml
E PROC               CREATED        - #02->#01 K01 - process.xml->"wf" (version:1)
E DEPLOYMENT         CREATED        - #03->#01 K02 - process.xml
E DEPLOYMENT         FULLY_DISTR    - #04->#01 K02 - 
C PROC_INST_CREATION CREATE         - #05-> -1  -1 - new <process "wf"> (no vars)
C PROC_INST          ACTIVATE       - #06->#05 K03 - PROCESS "wf" in <process "wf"[K03]>
E PROC_INST_CREATION CREATED        - #07->#05 K04 - new <process "wf"> (no vars)
E PROC_INST          ACTIVATING     - #08->#06 K03 - PROCESS "wf" in <process "wf"[K03]>
E PROC_INST          ACTIVATED      - #09->#06 K03 - PROCESS "wf" in <process "wf"[K03]>
C PROC_INST          ACTIVATE       - #10->#06  -1 - START_EVENT "startEv..156297a" in <process "wf"[K03]>
E PROC_INST          ACTIVATING     - #11->#10 K05 - START_EVENT "startEv..156297a" in <process "wf"[K03]>
E PROC_INST          ACTIVATED      - #12->#10 K05 - START_EVENT "startEv..156297a" in <process "wf"[K03]>
C PROC_INST          COMPLETE       - #13->#10 K05 - START_EVENT "startEv..156297a" in <process "wf"[K03]>
E PROC_INST          COMPLETING     - #14->#13 K05 - START_EVENT "startEv..156297a" in <process "wf"[K03]>
E PROC_INST          COMPLETED      - #15->#13 K05 - START_EVENT "startEv..156297a" in <process "wf"[K03]>
E PROC_INST          SEQ_FLOW_TAKEN - #16->#13 K06 - SEQUENCE_FLOW "sequenc..4784188" in <process "wf"[K03]>
C PROC_INST          ACTIVATE       - #17->#16 K07 - SERVICE_TASK "task" in <process "wf"[K03]>
E PROC_INST          ACTIVATING     - #18->#17 K07 - SERVICE_TASK "task" in <process "wf"[K03]>
E JOB                CREATED        - #19->#17 K08 - K08 "test" @"task"[K07] 3 retries, in <process "wf"[K03]> (no vars)
E PROC_INST          ACTIVATED      - #20->#17 K07 - SERVICE_TASK "task" in <process "wf"[K03]>
C JOB                THROW_ERROR    - #21-> -1 K08 - K08 "test" @""[ -1] -1 retries, error: in <process ?[?]> (no vars)
E JOB                ERROR_THROWN   - #22->#21 K08 - K08 "test" @"task"[K07] 3 retries, error: in <process "wf"[K03]> (no vars)
E PROC_EVNT          TRIGGERED      - #23->#21 K09 -  @"error-start"[K03] in <process K01[K03]> (no vars)
C PROC_INST          TERMINATE      - #24->#21 K07 - SERVICE_TASK "task" in <process "wf"[K03]>
E PROC_INST          TERMINATING    - #25->#24 K07 - SERVICE_TASK "task" in <process "wf"[K03]>
E PROC_INST          TERMINATED     - #26->#24 K07 - SERVICE_TASK "task" in <process "wf"[K03]>
E PROC_INST          ACTIVATING     - #27->#24 K10 - EVENT_SUB_PROCESS "error" in <process "wf"[K03]>
E PROC_INST          ACTIVATED      - #28->#27 K10 - EVENT_SUB_PROCESS "error" in <process "wf"[K03]>
C PROC_INST          ACTIVATE       - #29->#28  -1 - START_EVENT "error-start" in <process "wf"[K03]>
E PROC_INST          ACTIVATING     - #30->#29 K11 - START_EVENT "error-start" in <process "wf"[K03]>
E PROC_INST          ACTIVATED      - #31->#29 K11 - START_EVENT "error-start" in <process "wf"[K03]>
C PROC_INST          COMPLETE       - #32->#29 K11 - START_EVENT "error-start" in <process "wf"[K03]>
E PROC_INST          COMPLETING     - #33->#32 K11 - START_EVENT "error-start" in <process "wf"[K03]>
E PROC_INST          COMPLETED      - #34->#32 K11 - START_EVENT "error-start" in <process "wf"[K03]>
E PROC_INST          SEQ_FLOW_TAKEN - #35->#32 K12 - SEQUENCE_FLOW "sequenc..0b01f2d" in <process "wf"[K03]>
C PROC_INST          ACTIVATE       - #36->#35 K13 - SERVICE_TASK "task-in..process" in <process "wf"[K03]>
E PROC_INST          ACTIVATING     - #37->#36 K13 - SERVICE_TASK "task-in..process" in <process "wf"[K03]>
E JOB                CREATED        - #38->#36 K14 - K14 "test" @"task-in..process"[K13] 3 retries, in <process "wf"[K03]> (no vars)
E PROC_INST          ACTIVATED      - #39->#36 K13 - SERVICE_TASK "task-in..process" in <process "wf"[K03]>
C JOB                THROW_ERROR    - #40-> -1 K14 - K14 "test" @""[ -1] -1 retries, error: in <process ?[?]> (no vars)
R JOB                THROW_ERROR    - #41->#40 K14 - K14 "test" @""[ -1] -1 retries, error: in <process ?[?]> (no vars) !INVALID_STATE (Expected to find event scope that is accepting events, but was {"parentKey":-1,"childCount":1,"jobKey":0,"multiInstanceLoopCounter":0,"interruptingElementId":"error","calledChildInstanceKey":-1,"elementRecord":{"key":2251799813685251,"state":"ELEMENT_ACTIVATED","processInstanceRecord":{"bpmnProcessId":"wf","version":1,"processDefinitionKey":2251799813685249,"processInstanceKey":2251799813685251,"elementId":"wf","flowScopeKey":-1,"bpmnElementType":"PROCESS","parentProcessInstanceKey":-1,"parentElementInstanceKey":-1}},"activeSequenceFlows":0})

-------------- Deployed Processes ----------------------
process.xml ------ 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_879b0149-4a6a-4a29-9cff-e9fc95456285" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
  <process id="wf" isExecutable="true">
    <subProcess id="error" name="error" triggeredByEvent="true">
      <startEvent id="error-start" isInterrupting="true" name="error-start">
        <outgoing>sequenceFlow_b8601b7d-0e34-4435-bbe5-9eb250b01f2d</outgoing>
        <errorEventDefinition errorRef="error_9d90d9dc-29d2-4411-95c3-6cc0dd94180c" id="errorEventDefinition_ff48dbd3-7a1a-415c-a274-69e25a34d7c7"/>
      </startEvent>
      <serviceTask id="task-in-subprocess" name="task-in-subprocess">
        <extensionElements>
          <ns0:taskDefinition type="test"/>
        </extensionElements>
        <incoming>sequenceFlow_b8601b7d-0e34-4435-bbe5-9eb250b01f2d</incoming>
        <outgoing>sequenceFlow_6919d02a-1e93-494e-8499-3d58b13478d1</outgoing>
      </serviceTask>
      <sequenceFlow id="sequenceFlow_b8601b7d-0e34-4435-bbe5-9eb250b01f2d" sourceRef="error-start" targetRef="task-in-subprocess"/>
      <endEvent id="endEvent_8460daf6-4771-475b-95ab-0056c800d84b">
        <incoming>sequenceFlow_6919d02a-1e93-494e-8499-3d58b13478d1</incoming>
      </endEvent>
      <sequenceFlow id="sequenceFlow_6919d02a-1e93-494e-8499-3d58b13478d1" sourceRef="task-in-subprocess" targetRef="endEvent_8460daf6-4771-475b-95ab-0056c800d84b"/>
    </subProcess>
    <startEvent id="startEvent_c7ffd138-014a-4b6f-8d4f-a4347156297a">
      <outgoing>sequenceFlow_ccc1b105-0b25-4ecb-a83a-e3d4a4784188</outgoing>
    </startEvent>
    <serviceTask id="task" name="task">
      <extensionElements>
        <ns0:taskDefinition type="test"/>
      </extensionElements>
      <incoming>sequenceFlow_ccc1b105-0b25-4ecb-a83a-e3d4a4784188</incoming>
      <outgoing>sequenceFlow_dd0df775-62b7-4ce2-a213-5db386b94b4f</outgoing>
    </serviceTask>
    <sequenceFlow id="sequenceFlow_ccc1b105-0b25-4ecb-a83a-e3d4a4784188" sourceRef="startEvent_c7ffd138-014a-4b6f-8d4f-a4347156297a" targetRef="task"/>
    <endEvent id="endEvent_d122448c-adde-47e7-9fa5-5b9363745205">
      <incoming>sequenceFlow_dd0df775-62b7-4ce2-a213-5db386b94b4f</incoming>
    </endEvent>
    <sequenceFlow id="sequenceFlow_dd0df775-62b7-4ce2-a213-5db386b94b4f" sourceRef="task" targetRef="endEvent_d122448c-adde-47e7-9fa5-5b9363745205"/>
  </process>
  <error errorCode="error" id="error_9d90d9dc-29d2-4411-95c3-6cc0dd94180c"/>
  <bpmndi:BPMNDiagram id="BPMNDiagram_96b6deab-4d2b-4917-9432-1e487f122c42">
    <bpmndi:BPMNPlane bpmnElement="wf" id="BPMNPlane_ad41e0e7-d1d3-4a66-bb09-92f18b6c54e2">
      <bpmndi:BPMNShape bpmnElement="error" id="BPMNShape_0616f2ad-c551-473d-88b8-860941f4243a" isExpanded="true">
        <dc:Bounds height="200.0" width="372.0" x="100.0" y="250.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="error-start" id="BPMNShape_358ddb20-3d78-4f37-97ee-0c5c3da79275">
        <dc:Bounds height="36.0" width="36.0" x="150.0" y="332.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="task-in-subprocess" id="BPMNShape_06acac6f-8fc8-4cfc-8849-86aa5fd04248">
        <dc:Bounds height="80.0" width="100.0" x="236.0" y="310.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_b8601b7d-0e34-4435-bbe5-9eb250b01f2d" id="BPMNEdge_df15068c-b788-4b04-949e-b7025ef2d8f2">
        <di:waypoint x="186.0" y="350.0"/>
        <di:waypoint x="236.0" y="350.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape bpmnElement="endEvent_8460daf6-4771-475b-95ab-0056c800d84b" id="BPMNShape_def9cfed-5ef5-4f3b-95fc-a9c33c4e6fe6">
        <dc:Bounds height="36.0" width="36.0" x="386.0" y="332.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_6919d02a-1e93-494e-8499-3d58b13478d1" id="BPMNEdge_7a228df5-6c37-4212-9bb1-cfdb72d64461">
        <di:waypoint x="336.0" y="350.0"/>
        <di:waypoint x="386.0" y="350.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape bpmnElement="startEvent_c7ffd138-014a-4b6f-8d4f-a4347156297a" id="BPMNShape_0fc587db-0268-44b0-8d2a-89e6ec971d3a">
        <dc:Bounds height="36.0" width="36.0" x="100.0" y="100.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="task" id="BPMNShape_e7856611-a7b1-4cf3-9bfa-f1a47ae7b5bb">
        <dc:Bounds height="80.0" width="100.0" x="186.0" y="78.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_ccc1b105-0b25-4ecb-a83a-e3d4a4784188" id="BPMNEdge_20cde8c9-c2c5-4dbb-afea-23908640e840">
        <di:waypoint x="136.0" y="118.0"/>
        <di:waypoint x="186.0" y="118.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape bpmnElement="endEvent_d122448c-adde-47e7-9fa5-5b9363745205" id="BPMNShape_a90e04b8-d0b8-4132-be5a-166fff3a55d5">
        <dc:Bounds height="36.0" width="36.0" x="336.0" y="100.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_dd0df775-62b7-4ce2-a213-5db386b94b4f" id="BPMNEdge_0cd381b7-0eb7-4330-817c-e701cb1f6622">
        <di:waypoint x="286.0" y="118.0"/>
        <di:waypoint x="336.0" y="118.0"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

--------------- Decomposed keys (for debugging) -----------------
 -1 <-> -1
K01 <-> 2251799813685249
K02 <-> 2251799813685250
K03 <-> 2251799813685251
K04 <-> 2251799813685252
K05 <-> 2251799813685253
K06 <-> 2251799813685254
K07 <-> 2251799813685255
K08 <-> 2251799813685256
K09 <-> 2251799813685257
K10 <-> 2251799813685258
K11 <-> 2251799813685259
K12 <-> 2251799813685260
K13 <-> 2251799813685261
K14 <-> 2251799813685262


io.zeebe.test.util.stream.StreamWrapperException: No event found matching the criteria

	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at io.zeebe.test.util.stream.StreamWrapper.getFirst(StreamWrapper.java:77)
	at io.zeebe.engine.processing.incident.ErrorEventIncidentTest.shouldCreateIncidentIfErrorIsThrownFromInterruptingEventSubprocess(ErrorEventIncidentTest.java:161)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:43)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:82)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:73)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)

@Zelldon
Copy link
Member Author

Zelldon commented Apr 17, 2021

@npepinpe question regarding the ProcessEvent, is it planned to write that event also for the other triggers ? Like message and timer?

P.S.: This would reduce my duplication of code in the appliers.

P.S.S: maybe makes sense to have for different catch event type a different intent instead of one. So instead of TRIGGERED we have, BOUNDARY_TRIGGERED, EVENT_SUB_TRIGGERED, START_EVENT_TRIGGERED, INTERMEDIATE_TRIGGERED then we could have different implementations of appliers IF we need them, like for the event sub process.

@saig0
Copy link
Member

saig0 commented Apr 19, 2021

My current issue is one failing test, which expects a incident instead of a rejection. I'm not sure whether it would be also fine to just have the rejection instead.

The test in question is ErrorEventIncidentTest#shouldCreateIncidentWithDefaultErrorMessage

I guess that the failure test is ErrorEventIncidentTest#shouldCreateIncidentIfErrorIsThrownFromInterruptingEventSubprocess.

In the test case, an interrupting event-subprocess is triggered and the process instance waits in a service task inside the subprocess. It throws an error and expects that an incident is created because the error is not caught.

In this case, we must create an incident. A rejection would not be visible to the user and would behave differently (i.e. endless retry because the job is not completed or failed).

The behavior changed because of these changes: https://github.com/camunda-cloud/zeebe/pull/6813/files#diff-f7a8bbe8884d202edc2b5f5cad1912bd9c4018191689cea3ec8a167986ad6998L65-R75
Here, the catch event is returned before checking if the instance was interrupted.

@Zelldon
Copy link
Member Author

Zelldon commented Apr 19, 2021

Hey @saig0 thanks for your input. Yeah sorry I copied the wrong name😅🙈 yes I needed to change that because the marker is now set before the triggering and not after😅

Any idea on this? Do you have later sometime for this?

@saig0
Copy link
Member

saig0 commented Apr 19, 2021

regarding the ProcessEvent, is it planned to write that event also for the other triggers ? Like message and timer?

It is not planned yet. Currently, it is not necessary because we have the data in the other records.

If this would increase the maintainability then we could also introduce it for the other events. Another option would be to extract the common behavior into a class that is used by the different event appliers.

For now, I suggest trying it without using the record for other events and keep it simple. We can revisit it when doing the clean up.

@Zelldon Zelldon force-pushed the zell-migrate-interrupting-event-sub branch from e7d3542 to c795ddf Compare April 19, 2021 06:36
@Zelldon Zelldon marked this pull request as ready for review April 19, 2021 06:36
Comment on lines +114 to +117
if (flowScopeElementInstance.isInterrupted()
&& !flowScopeElementInstance
.getInterruptingElementId()
.equals(startEvent.getEventSubProcess())) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now necessary because we mark the flow scope before the triggering

@saig0 saig0 removed the request for review from npepinpe April 19, 2021 07:02
Copy link
Member

@saig0 saig0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

I've only one optional suggestion. Please have a look 🍪

 Moves the event sub process interruption marker to related EventAppliers, in order to have no longer state changes in the processing (updating the flow scope element instance).
 The interruption marker is changed from the element instance key to the corresponding element id, since this the available information we have in the applier. This change allows to migrate the event sub processes.
@Zelldon Zelldon force-pushed the zell-migrate-interrupting-event-sub branch from c795ddf to 3f8a069 Compare April 19, 2021 07:46
@Zelldon
Copy link
Member Author

Zelldon commented Apr 19, 2021

bors r+

@ghost
Copy link

ghost commented Apr 19, 2021

Build succeeded:

@ghost ghost merged commit bbdab19 into develop Apr 19, 2021
@ghost ghost deleted the zell-migrate-interrupting-event-sub branch April 19, 2021 08:34
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants