use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testEndMessageEventEquals.
@Test
public void testEndMessageEventEquals() {
final String MESSAGE_REF = "message ref";
final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, ""));
final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, ""));
final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value", ""));
final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(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"));
EndMessageEvent a = new EndMessageEvent();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
EndMessageEvent b = new EndMessageEvent();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
EndMessageEvent c = new EndMessageEvent();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
EndMessageEvent d = new EndMessageEvent();
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);
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 e = new EndSignalEvent();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet in project kie-wb-common by kiegroup.
the class EndEventConverter method messageEventDefinition.
private BpmnNode messageEventDefinition(EndEvent event, MessageEventDefinition e) {
Node<View<EndMessageEvent>, Edge> node = factoryManager.newNode(event.getId(), EndMessageEvent.class);
EndMessageEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new MessageEventExecutionSet(new MessageRef(EventDefinitionReader.messageRefOf(e), EventDefinitionReader.messageRefStructureOf(e))));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node, p);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverter method messageEvent.
protected BpmnNode messageEvent(IntermediateThrowEvent event, MessageEventDefinition eventDefinition) {
Node<View<IntermediateMessageEventThrowing>, Edge> node = factoryManager.newNode(event.getId(), IntermediateMessageEventThrowing.class);
IntermediateMessageEventThrowing definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
node.getContent().setBounds(p.getBounds());
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new MessageEventExecutionSet(new MessageRef(EventDefinitionReader.messageRefOf(eventDefinition), EventDefinitionReader.messageRefStructureOf(eventDefinition))));
return BpmnNode.of(node, p);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method IntermediateMessageEventThrowingEquals.
@Test
public void IntermediateMessageEventThrowingEquals() {
final String MESSAGE_REF = "message ref";
final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, ""));
final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, ""));
final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value", ""));
final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(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"));
IntermediateMessageEventThrowing a = new IntermediateMessageEventThrowing();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
IntermediateMessageEventThrowing b = new IntermediateMessageEventThrowing();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
IntermediateMessageEventThrowing c = new IntermediateMessageEventThrowing();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
IntermediateMessageEventThrowing d = new IntermediateMessageEventThrowing();
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 e = new EndSignalEvent();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet in project kie-wb-common by kiegroup.
the class EndEventConverter method messageEvent.
private PropertyWriter messageEvent(Node<View<EndMessageEvent>, ?> n) {
EndEvent event = bpmn2.createEndEvent();
event.setId(n.getUUID());
EndMessageEvent definition = n.getContent().getDefinition();
ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
MessageEventExecutionSet executionSet = definition.getExecutionSet();
p.addMessage(executionSet.getMessageRef());
p.setAbsoluteBounds(n);
return p;
}
Aggregations