Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-2275

Support all EventDefinitions except Escalation in BPMN model API

      AT:

      • implement CancelEventDefiniton
      • implement CompensateEventDefiniton
      • implement ConditionalEventDefiniton
      • implement ErrorEventDefiniton
      • implement LinkEventDefiniton
      • implement SignalEventDefiniton
      • implement TerminateEventDefiniton
      • implement TimerEventDefiniton

      ======

      I am getting this model exception while trying to add an outgoing sequence flow to an intermediateCatchEvent.

      org.camunda.bpm.model.xml.ModelException: New child is not a valid child element type: timerEventDefinition; valid types are: [documentation, extensionElements, documentation, extensionElements, auditing, monitoring, categoryValueRef, auditing, monitoring, categoryValueRef, incoming, outgoing, incoming, outgoing, property, property, dataOutput, dataOutputAssociation, outputSet, eventDefinition, eventDefinitionRef, dataOutput, dataOutputAssociation, outputSet, eventDefinition, eventDefinitionRef]
      at org.camunda.bpm.model.xml.impl.util.ModelUtil.getIndexOfElementType(ModelUtil.java:167)
      at org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl.findElementToInsertAfter(ModelElementInstanceImpl.java:286)
      at org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl.addChildElement(ModelElementInstanceImpl.java:245)
      at org.camunda.bpm.model.xml.impl.type.child.ChildElementCollectionImpl.performAddOperation(ChildElementCollectionImpl.java:111)
      at org.camunda.bpm.model.xml.impl.type.child.ChildElementCollectionImpl.access$200(ChildElementCollectionImpl.java:34)
      at org.camunda.bpm.model.xml.impl.type.child.ChildElementCollectionImpl$1.add(ChildElementCollectionImpl.java:182)
      at org.camunda.bpm.model.xml.impl.type.child.ChildElementCollectionImpl$1.add(ChildElementCollectionImpl.java:131)
      at org.camunda.bpm.model.xml.impl.type.reference.ElementReferenceCollectionImpl.performAddOperation(ElementReferenceCollectionImpl.java:68)
      at org.camunda.bpm.model.xml.impl.type.reference.ElementReferenceCollectionImpl.access$200(ElementReferenceCollectionImpl.java:37)
      at org.camunda.bpm.model.xml.impl.type.reference.ElementReferenceCollectionImpl$1.add(ElementReferenceCollectionImpl.java:173)
      at org.camunda.bpm.model.xml.impl.type.reference.ElementReferenceCollectionImpl$1.add(ElementReferenceCollectionImpl.java:130)
      at com.sigma.omp.bpm.model.BpmnDiEdit.createSequenceFlow(BpmnDiEdit.java:496)
      at com.sigma.omp.bpm.model.BpmnDiEdit.insertNode(BpmnDiEdit.java:98)
      at com.sigma.omp.bpm.model.BpmnDiEdit.insertNode(BpmnDiEdit.java:89)
      at com.sigma.omp.bpm.model.BpmnDiEditTest.insertNewElement(BpmnDiEditTest.java:93)
      at com.sigma.omp.bpm.model.BpmnDiEditTest.insertNewElement(BpmnDiEditTest.java:67)
      at com.sigma.omp.bpm.model.BpmnDiEditTest.insertNewElementAtBottomBand(BpmnDiEditTest.java:58)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

        This is the controller panel for Smart Panels app

            [CAM-2275] Support all EventDefinitions except Escalation in BPMN model API

            In BpmnModelConstants.java I see only these types of event definitions supported:

            public static final String BPMN_ELEMENT_EVENT_DEFINITION = "eventDefinition";
            public static final String BPMN_ELEMENT_EVENT_DEFINITION_REF = "eventDefinitionRef";
            public static final String BPMN_ELEMENT_MESSAGE_EVENT_DEFINITION = "messageEventDefinition";

            In my case I have intermediateCatchEvent defined like this:
            <intermediateCatchEvent id="TimerForDateOfActivation" name="TimerCatchEvent">
            <incoming>flow70</incoming>
            <outgoing>flow72</outgoing>
            <timerEventDefinition>
            <timeDuration xsi:type="tFormalExpression">${ompExecutionContext.getScheduleTime()}</timeDuration>
            </timerEventDefinition>
            </intermediateCatchEvent>

            However, the generic issue here is : the library throws exception when I try to add anything below an element which has an unsupported child element.
            In my case I was simply adding an <outgoing> element. While determining where to add <outgoing> element, the library saw an unsupported element <timerEventDefinition> and threw an exception.

            Ganesh Ingle added a comment - In BpmnModelConstants.java I see only these types of event definitions supported: public static final String BPMN_ELEMENT_EVENT_DEFINITION = "eventDefinition"; public static final String BPMN_ELEMENT_EVENT_DEFINITION_REF = "eventDefinitionRef"; public static final String BPMN_ELEMENT_MESSAGE_EVENT_DEFINITION = "messageEventDefinition"; In my case I have intermediateCatchEvent defined like this: <intermediateCatchEvent id="TimerForDateOfActivation" name="TimerCatchEvent"> <incoming>flow70</incoming> <outgoing>flow72</outgoing> <timerEventDefinition> <timeDuration xsi:type="tFormalExpression">${ompExecutionContext.getScheduleTime()}</timeDuration> </timerEventDefinition> </intermediateCatchEvent> However, the generic issue here is : the library throws exception when I try to add anything below an element which has an unsupported child element. In my case I was simply adding an <outgoing> element. While determining where to add <outgoing> element, the library saw an unsupported element <timerEventDefinition> and threw an exception.

            Hi Ganesh,

            tank you for your feedback again. It is correct that the bpmn model api is not able to handle unknown elements. So to solve your problem we have to implement TimerEventDefinition otherwise we cannot guarantee the correct ordering of the child elements. This is a known restriction of the bpmn model api.

            Cheers,
            Sebastian

            Sebastian Menski added a comment - Hi Ganesh, tank you for your feedback again. It is correct that the bpmn model api is not able to handle unknown elements. So to solve your problem we have to implement TimerEventDefinition otherwise we cannot guarantee the correct ordering of the child elements. This is a known restriction of the bpmn model api. Cheers, Sebastian

            Can we contribute TimerEventDefinition support to you guys? Because otherwise our company has to maintain an internal version of this project. That would obviously be more costly for us than to contribute this feature to project.

            Ganesh Ingle added a comment - Can we contribute TimerEventDefinition support to you guys? Because otherwise our company has to maintain an internal version of this project. That would obviously be more costly for us than to contribute this feature to project.

            Hi Ganesh,

            it would be great if you would contribute your bug fixes. As the project is open source on GitHub (https://github.com/camunda/camunda-bpmn-model) it is easy for your to submit your changes. Please follow our contributing guidelines (https://github.com/camunda/camunda-bpm-platform/blob/master/CONTRIBUTING.md) and submit a pull request. We will than review it and merge it into the master.

            Cheers,
            Sebastian

            Sebastian Menski added a comment - Hi Ganesh, it would be great if you would contribute your bug fixes. As the project is open source on GitHub ( https://github.com/camunda/camunda-bpmn-model ) it is easy for your to submit your changes. Please follow our contributing guidelines ( https://github.com/camunda/camunda-bpm-platform/blob/master/CONTRIBUTING.md ) and submit a pull request. We will than review it and merge it into the master. Cheers, Sebastian

            commited on branch CAM-2275 (bpmn-model repo) which depends on branch CAM-2298 (bpmn-model repo) and already backported

            Sebastian Menski added a comment - commited on branch CAM-2275 (bpmn-model repo) which depends on branch CAM-2298 (bpmn-model repo) and already backported

            merged on master

            Sebastian Menski added a comment - merged on master

              meyer Daniel Meyer
              ganesh Ganesh Ingle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: