use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method messageEvent.
private PropertyWriter messageEvent(Node<View<IntermediateMessageEventCatching>, ?> n) {
CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
p.getFlowElement().setId(n.getUUID());
IntermediateMessageEventCatching definition = n.getContent().getDefinition();
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
CancellingMessageEventExecutionSet executionSet = definition.getExecutionSet();
p.addMessage(executionSet.getMessageRef());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching in project kie-wb-common by kiegroup.
the class ProcessMessageRefProviderTest method mockIntermediateMessageEventCatchingNode.
private Element mockIntermediateMessageEventCatchingNode(String messageRefValue) {
IntermediateMessageEventCatching event = new IntermediateMessageEventCatching();
event.setExecutionSet(new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(messageRefValue)));
return mockNode(event);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateMessageEventCatching.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateMessageEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTCATCHING);
assertDiagram(diagram, 2);
assertEquals("IntermediateMessageEventCatching", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> intermediateMessageEventCatchingNode = diagram.getGraph().getNode("_BD708E30-CA48-4051-BAEA-BBCB5F396CEE");
IntermediateMessageEventCatching intermediateMessageEventCatching = (IntermediateMessageEventCatching) intermediateMessageEventCatchingNode.getContent().getDefinition();
assertNotNull(intermediateMessageEventCatching.getExecutionSet());
MessageRef messageRef = intermediateMessageEventCatching.getExecutionSet().getMessageRef();
assertEquals("msgref1", messageRef.getValue());
DataIOSet dataIOSet = intermediateMessageEventCatching.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||IntermediateMessageEventCatchingOutputVar1:String||[dout]IntermediateMessageEventCatchingOutputVar1->var1", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallIntermediateMessageEventCatching.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateMessageEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTCATCHING);
assertDiagram(diagram, 2);
assertEquals("IntermediateMessageEventCatching", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> intermediateMessageEventCatchingNode = diagram.getGraph().getNode("_BD708E30-CA48-4051-BAEA-BBCB5F396CEE");
IntermediateMessageEventCatching intermediateMessageEventCatching = (IntermediateMessageEventCatching) intermediateMessageEventCatchingNode.getContent().getDefinition();
assertNotNull(intermediateMessageEventCatching.getExecutionSet());
MessageRef messageRef = intermediateMessageEventCatching.getExecutionSet().getMessageRef();
assertEquals("msgref1", messageRef.getValue());
DataIOSet dataIOSet = intermediateMessageEventCatching.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||IntermediateMessageEventCatchingOutputVar1:String||[dout]IntermediateMessageEventCatchingOutputVar1->var1", assignmentsInfo.getValue());
}
Aggregations