Search in sources :

Example 1 with CancelActivity

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverter method messageEvent.

private BpmnNode messageEvent(CatchEvent event, MessageEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateMessageEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateMessageEventCatching.class);
    IntermediateMessageEventCatching definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new CancellingMessageEventExecutionSet(new CancelActivity(p.isCancelActivity()), new MessageRef(e.getMessageRef().getName())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) EventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 2 with CancelActivity

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverter method signalEvent.

private BpmnNode signalEvent(CatchEvent event, SignalEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateSignalEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateSignalEventCatching.class);
    IntermediateSignalEventCatching definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new CancellingSignalEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SignalRef(p.getSignalRef())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) EventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) CancellingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.CancellingSignalEventExecutionSet) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 3 with CancelActivity

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverter method timerEvent.

private BpmnNode timerEvent(CatchEvent event, TimerEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateTimerEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateTimerEvent.class);
    IntermediateTimerEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new CancellingTimerEventExecutionSet(new CancelActivity(p.isCancelActivity()), new TimerSettings(p.getTimerSettings(e))));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : TimerSettings(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings) CancellingTimerEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.CancellingTimerEventExecutionSet) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) EventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 4 with CancelActivity

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity in project kie-wb-common by kiegroup.

the class HashCodeAndEqualityTest method IntermediateMessageEventCatchingEquals.

@Test
public void IntermediateMessageEventCatchingEquals() {
    final String MESSAGE_REF = "message ref";
    final CancellingMessageEventExecutionSet A_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(MESSAGE_REF));
    final CancellingMessageEventExecutionSet B_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(MESSAGE_REF));
    final CancellingMessageEventExecutionSet C_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef("Other value"));
    final CancellingMessageEventExecutionSet D_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(MESSAGE_REF));
    final String ASSIGNMENT_INFO = "some value";
    final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
    IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
    IntermediateMessageEventCatching a = builder.build();
    a.setExecutionSet(A_EXECUTION_SET);
    a.setDataIOSet(A_DATA_SET);
    builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
    IntermediateMessageEventCatching b = builder.build();
    b.setExecutionSet(B_EXECUTION_SET);
    b.setDataIOSet(B_DATA_SET);
    builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
    IntermediateMessageEventCatching c = builder.build();
    c.setExecutionSet(C_EXECUTION_SET);
    c.setDataIOSet(C_DATA_SET);
    builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
    IntermediateMessageEventCatching d = builder.build();
    d.setExecutionSet(D_EXECUTION_SET);
    d.setDataIOSet(D_DATA_SET);
    assertEquals(a, a);
    assertEquals(a, b);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    assertNotEquals(a, 19);
    assertNotEquals(a, null);
    a.setExecutionSet(null);
    assertNotEquals(a, b);
    assertNotEquals(b, a);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    a.setExecutionSet(A_EXECUTION_SET);
    assertEquals(a, b);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    a.setDataIOSet(null);
    assertNotEquals(a, b);
    assertNotEquals(b, a);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    EndSignalEvent.EndSignalEventBuilder builderSignal = new EndSignalEvent.EndSignalEventBuilder();
    EndSignalEvent e = builderSignal.build();
    assertNotEquals(a, e);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity) Test(org.junit.Test)

Example 5 with CancelActivity

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity in project kie-wb-common by kiegroup.

the class ProcessErrorRefProviderTest method mockIntermediateErrorEventCatchingNode.

private Node mockIntermediateErrorEventCatchingNode(String errorRefValue) {
    IntermediateErrorEventCatching event = new IntermediateErrorEventCatching();
    event.setExecutionSet(new CancellingErrorEventExecutionSet(new CancelActivity(true), new ErrorRef(errorRefValue)));
    return mockNode(event);
}
Also used : IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Aggregations

CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)8 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)4 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)4 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)4 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)4 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)4 Edge (org.kie.workbench.common.stunner.core.graph.Edge)4 View (org.kie.workbench.common.stunner.core.graph.content.view.View)4 CancellingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet)3 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)3 IntermediateErrorEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching)2 IntermediateMessageEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching)2 IntermediateSignalEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching)2 CancellingErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet)2 ErrorRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef)2 CancellingSignalEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.CancellingSignalEventExecutionSet)2 SignalRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef)2 Test (org.junit.Test)1 IntermediateTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent)1