use of org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testEndEscalationEventEqualsAndHashCode.
@Test
public void testEndEscalationEventEqualsAndHashCode() {
String ESCALATION_REF = "ESCALATION_REF";
String ESCALATION_REF_1 = "ESCALATION_REF_1";
TestCaseBuilder.newTestCase().addTrueCase(new EndEscalationEvent(), new EndEscalationEvent()).addTrueCase(new EndEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(), new DataIOSet())).addFalseCase(new EndEscalationEvent(), null).addTrueCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(), new DataIOSet())).addTrueCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet())).addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet())).addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF_1)), new DataIOSet())).addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet("data"))).addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(null), new DataIOSet())).addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new AdvancedData(), null, new DataIOSet())).test();
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef in project kie-wb-common by kiegroup.
the class EndEventConverter method escalationEventDefinition.
private BpmnNode escalationEventDefinition(EndEvent event, EscalationEventDefinition e) {
Node<View<EndEscalationEvent>, Edge> node = factoryManager.newNode(event.getId(), EndEscalationEvent.class);
EndEscalationEvent 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 EscalationEventExecutionSet(new EscalationRef(EventDefinitionReader.escalationRefOf(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.escalation.EscalationRef in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverter method escalationEvent.
protected BpmnNode escalationEvent(IntermediateThrowEvent event, EscalationEventDefinition eventDefinition) {
Node<View<IntermediateEscalationEventThrowing>, Edge> node = factoryManager.newNode(event.getId(), IntermediateEscalationEventThrowing.class);
IntermediateEscalationEventThrowing 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 EscalationEventExecutionSet(new EscalationRef(EventDefinitionReader.escalationRefOf(eventDefinition))));
return BpmnNode.of(node, p);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverterTest method setUp.
@Before
public void setUp() {
Event boundaryEvent = bpmn2.createBoundaryEvent();
boundaryEventPropertyWriter = spy(new BoundaryEventPropertyWriter((BoundaryEvent) spy(boundaryEvent), new FlatVariableScope(), new HashSet<>()));
// when(boundaryEventPropertyWriter.getFlowElement()).thenReturn(spy(FlowElement.class));
Event catchEvent = bpmn2.createIntermediateCatchEvent();
catchEventPropertyWriter = spy(new CatchEventPropertyWriter((CatchEvent) spy(catchEvent), new FlatVariableScope(), new HashSet<>()));
propertyWriterFactory = spy(PropertyWriterFactory.class);
when(propertyWriterFactory.of(any(BoundaryEvent.class))).thenReturn(boundaryEventPropertyWriter);
when(propertyWriterFactory.of(any(CatchEvent.class))).thenReturn(catchEventPropertyWriter);
generalSet = new BPMNGeneralSet(NAME, DOCUMENTATION);
assignmentsInfo = new AssignmentsInfo(ASSIGNMENTS_INFO);
dataIOSet = new DataIOSet(assignmentsInfo);
advancedData = new AdvancedData();
slaDueDate = mock(SLADueDate.class);
errorRef = mock(ErrorRef.class);
signalRef = mock(SignalRef.class);
linkRef = mock(LinkRef.class);
timerSettingsValue = mock(TimerSettingsValue.class);
timerSettings = new TimerSettings(timerSettingsValue);
messageRef = mock(MessageRef.class);
scriptTypeValue = mock(ScriptTypeValue.class);
conditionExpression = new ConditionExpression(scriptTypeValue);
escalationRef = mock(EscalationRef.class);
tested = spy(new IntermediateCatchEventConverter(propertyWriterFactory));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef in project kie-wb-common by kiegroup.
the class ProcessEscalationRefProviderTest method mockIntermediateEscalationEventThrowingNode.
private Node mockIntermediateEscalationEventThrowingNode(String escalationRefValue) {
IntermediateEscalationEventThrowing event = new IntermediateEscalationEventThrowing();
event.setExecutionSet(new EscalationEventExecutionSet(new EscalationRef(escalationRefValue)));
return mockNode(event);
}
Aggregations