Search in sources :

Example 16 with CatchEventPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverter method conditionalEvent.

protected PropertyWriter conditionalEvent(Node<View<IntermediateConditionalEvent>, ?> n) {
    CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
    p.getFlowElement().setId(n.getUUID());
    p.setAbsoluteBounds(n);
    IntermediateConditionalEvent definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    CancellingConditionalEventExecutionSet executionSet = definition.getExecutionSet();
    p.setCancelActivity(executionSet.getCancelActivity().getValue());
    p.addSlaDueDate(executionSet.getSlaDueDate());
    p.addCondition(executionSet.getConditionExpression());
    return p;
}
Also used : CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingConditionalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.CancellingConditionalEventExecutionSet)

Example 17 with CatchEventPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverter method errorEvent.

protected PropertyWriter errorEvent(Node<View<IntermediateErrorEventCatching>, ?> n) {
    CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
    p.getFlowElement().setId(n.getUUID());
    p.setAbsoluteBounds(n);
    IntermediateErrorEventCatching definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    CancellingErrorEventExecutionSet executionSet = definition.getExecutionSet();
    p.setCancelActivity(executionSet.getCancelActivity().getValue());
    p.addSlaDueDate(executionSet.getSlaDueDate());
    p.addError(executionSet.getErrorRef());
    return p;
}
Also used : CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet)

Example 18 with CatchEventPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverter method timerEvent.

protected PropertyWriter timerEvent(Node<View<IntermediateTimerEvent>, ?> n) {
    CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
    p.getFlowElement().setId(n.getUUID());
    p.setAbsoluteBounds(n);
    IntermediateTimerEvent definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    CancellingTimerEventExecutionSet executionSet = definition.getExecutionSet();
    p.setCancelActivity(executionSet.getCancelActivity().getValue());
    p.addSlaDueDate(executionSet.getSlaDueDate());
    p.addTimer(executionSet.getTimerSettings());
    return p;
}
Also used : CancellingTimerEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.CancellingTimerEventExecutionSet) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)

Example 19 with CatchEventPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverterTest method createCatchEventPropertyWriter.

@Test
public void createCatchEventPropertyWriter() {
    Node node1 = mockNode();
    CatchEventPropertyWriter result1 = tested.createCatchEventPropertyWriter(node1);
    Node node2 = mockDockedNode(mock(Node.class), null);
    CatchEventPropertyWriter result2 = tested.createCatchEventPropertyWriter(node2);
    verify(propertyWriterFactory).of(any(BoundaryEvent.class));
    verify(propertyWriterFactory).of(any(IntermediateCatchEvent.class));
    assertFalse(result1 instanceof BoundaryEventPropertyWriter);
    assertTrue(result1 instanceof CatchEventPropertyWriter);
    assertTrue(result2 instanceof BoundaryEventPropertyWriter);
}
Also used : BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) Node(org.kie.workbench.common.stunner.core.graph.Node) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) BoundaryEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter) Test(org.junit.Test)

Aggregations

CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)19 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)17 StartEvent (org.eclipse.bpmn2.StartEvent)9 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)8 BoundaryEvent (org.eclipse.bpmn2.BoundaryEvent)2 IntermediateCatchEvent (org.eclipse.bpmn2.IntermediateCatchEvent)2 Test (org.junit.Test)2 BoundaryEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter)2 FlatVariableScope (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.FlatVariableScope)2 IntermediateCompensationEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent)2 IntermediateConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent)2 IntermediateEscalationEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent)2 IntermediateTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent)2 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 BaseStartEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseStartEventExecutionSet)2 CatchEvent (org.eclipse.bpmn2.CatchEvent)1 Event (org.eclipse.bpmn2.Event)1 Before (org.junit.Before)1 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)1 BPMNDiagramMarshallerBaseTest (org.kie.workbench.common.stunner.bpmn.backend.service.diagram.marshalling.BPMNDiagramMarshallerBaseTest)1