use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet in project kie-wb-common by kiegroup.
the class StartEventConverter method messageEvent.
private BpmnNode messageEvent(StartEvent event, MessageEventDefinition e) {
Node<View<StartMessageEvent>, Edge> node = factoryManager.newNode(event.getId(), StartMessageEvent.class);
StartMessageEvent 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 InterruptingMessageEventExecutionSet(new IsInterrupting(event.isIsInterrupting()), new MessageRef(e.getMessageRef().getName())));
definition.setSimulationSet(p.getSimulationSet());
node.getContent().setBounds(p.getBounds());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
definition.setDimensionsSet(p.getCircleDimensionSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet in project kie-wb-common by kiegroup.
the class ProcessMessageRefProviderTest method mockStartMessageEventNode.
private Element mockStartMessageEventNode(String messageRefValue) {
StartMessageEvent event = new StartMessageEvent();
event.setExecutionSet(new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef(messageRefValue)));
return mockNode(event);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallIsInterruptingStartMessageEvent.
@Test
public void testUnmarshallIsInterruptingStartMessageEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTMESSAGEEVENT);
assertDiagram(diagram, 7);
assertEquals("EventSubprocessStartMessageEvent", diagram.getMetadata().getTitle());
// Check first start event with all FILLED properties
Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("_77E79714-F32A-4BE7-B0D2-15178F5244F0");
StartMessageEvent startMessageEvent = (StartMessageEvent) startEventNode.getContent().getDefinition();
BPMNGeneralSet eventGeneralSet = startMessageEvent.getGeneral();
assertNotNull(eventGeneralSet);
assertEquals("StartMessageEvent", eventGeneralSet.getName().getValue());
assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
InterruptingMessageEventExecutionSet eventExecutionSet = startMessageEvent.getExecutionSet();
assertNotNull(eventExecutionSet);
assertNotNull(eventExecutionSet.getMessageRef());
assertEquals("Message1", eventExecutionSet.getMessageRef().getValue());
assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
DataIOSet eventDataIOSet = startMessageEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
// Check second start event with all EMPTY properties
Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("_E4563AE4-5F70-4283-A5AC-C9AB14F15EBA");
StartMessageEvent emptyMessageEvent = (StartMessageEvent) emptyEventNode.getContent().getDefinition();
BPMNGeneralSet emptyEventGeneralSet = emptyMessageEvent.getGeneral();
assertNotNull(emptyEventGeneralSet);
assertEquals("", emptyEventGeneralSet.getName().getValue());
assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
InterruptingMessageEventExecutionSet emptyExecutionSet = emptyMessageEvent.getExecutionSet();
assertNotNull(emptyExecutionSet);
assertNotNull(emptyExecutionSet.getMessageRef());
assertEquals("", emptyExecutionSet.getMessageRef().getValue());
assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
DataIOSet emptyDataIOSet = emptyMessageEvent.getDataIOSet();
AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
assertEquals("", emptyAssignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testStartMessageEventEquals.
@Test
public void testStartMessageEventEquals() {
final String MESSAGE_REF = "message ref";
final InterruptingMessageEventExecutionSet A_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef(MESSAGE_REF));
final InterruptingMessageEventExecutionSet B_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef(MESSAGE_REF));
final InterruptingMessageEventExecutionSet C_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef("Other value"));
final InterruptingMessageEventExecutionSet D_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(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"));
StartMessageEvent.StartMessageEventBuilder builder = new StartMessageEvent.StartMessageEventBuilder();
StartMessageEvent a = builder.build();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
builder = new StartMessageEvent.StartMessageEventBuilder();
StartMessageEvent b = builder.build();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
builder = new StartMessageEvent.StartMessageEventBuilder();
StartMessageEvent c = builder.build();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
builder = new StartMessageEvent.StartMessageEventBuilder();
StartMessageEvent 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet in project kie-wb-common by kiegroup.
the class StartEventConverter method messageEvent.
private PropertyWriter messageEvent(Node<View<StartMessageEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartMessageEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
InterruptingMessageEventExecutionSet executionSet = definition.getExecutionSet();
p.addMessage(executionSet.getMessageRef());
p.setBounds(n.getContent().getBounds());
return p;
}
Aggregations