Search in sources :

Example 1 with CancellingEscalationEventExecutionSet

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

the class IntermediateCatchEventConverterTest method createIntermediateEscalationEventCatchingNode.

private Node createIntermediateEscalationEventCatchingNode() {
    CancellingEscalationEventExecutionSet executionSet = new CancellingEscalationEventExecutionSet(new CancelActivity(CANCEL_ACTIVITY), slaDueDate, escalationRef);
    IntermediateEscalationEvent eventCatching = new IntermediateEscalationEvent(generalSet, mock(BackgroundSet.class), mock(FontSet.class), mock(CircleDimensionSet.class), dataIOSet, advancedData, executionSet);
    Node dockNode = mockNode();
    Node node = mockDockedNode(dockNode, eventCatching);
    return node;
}
Also used : FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) CircleDimensionSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet) Node(org.kie.workbench.common.stunner.core.graph.Node) CancellingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 2 with CancellingEscalationEventExecutionSet

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

the class HashCodeAndEqualityTest method testIntermediateEscalationCatchingEventEqualsAndHashCode.

@Test
public void testIntermediateEscalationCatchingEventEqualsAndHashCode() {
    String ESCALATION_REF = "ESCALATION_REF";
    String ESCALATION_REF_1 = "ESCALATION_REF_1";
    TestCaseBuilder.newTestCase().addTrueCase(new IntermediateEscalationEvent(), new IntermediateEscalationEvent()).addTrueCase(new IntermediateEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet()), new IntermediateEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet())).addFalseCase(new IntermediateEscalationEvent(), null).addFalseCase(new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet()), new IntermediateEscalationEvent(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet())).addFalseCase(new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(true), new SLADueDate(), new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF)))).addFalseCase(new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(true), new SLADueDate(), new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(true), new SLADueDate(), new EscalationRef(ESCALATION_REF_1)))).addFalseCase(new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet("data"), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF)))).addFalseCase(new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet("data"), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet(null, new SLADueDate(), new EscalationRef(ESCALATION_REF)))).addFalseCase(new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet("data"), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), null))).addFalseCase(new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet("data"), new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), null, new AdvancedData(), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF)))).test();
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) CircleDimensionSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) CancellingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity) Test(org.junit.Test)

Example 3 with CancellingEscalationEventExecutionSet

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

the class HashCodeAndEqualityTest method testCancellingEscalationEventExecutionSetEqualsAndHashCode.

@Test
public void testCancellingEscalationEventExecutionSetEqualsAndHashCode() {
    String ESCALATION_REF = "ESCALATION_REF";
    String ESCALATION_REF_1 = "ESCALATION_REF_1";
    TestCaseBuilder.newTestCase().addTrueCase(new CancellingEscalationEventExecutionSet(), new CancellingEscalationEventExecutionSet()).addTrueCase(new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef()), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef())).addTrueCase(new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF)), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF))).addFalseCase(new CancellingEscalationEventExecutionSet(), null).addFalseCase(new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF)), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new SLADueDate(), new EscalationRef(ESCALATION_REF_1))).test();
}
Also used : SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) CancellingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity) Test(org.junit.Test)

Example 4 with CancellingEscalationEventExecutionSet

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

the class IntermediateCatchEventConverter method escalationEvent.

protected PropertyWriter escalationEvent(Node<View<IntermediateEscalationEvent>, ?> n) {
    CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
    p.getFlowElement().setId(n.getUUID());
    p.setAbsoluteBounds(n);
    IntermediateEscalationEvent definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    CancellingEscalationEventExecutionSet executionSet = definition.getExecutionSet();
    p.setCancelActivity(executionSet.getCancelActivity().getValue());
    p.addSlaDueDate(executionSet.getSlaDueDate());
    p.addEscalation(executionSet.getEscalationRef());
    return p;
}
Also used : IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet)

Example 5 with CancellingEscalationEventExecutionSet

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

the class IntermediateCatchEventConverter method escalationEvent.

protected Result<BpmnNode> escalationEvent(CatchEvent event, EscalationEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateEscalationEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateEscalationEvent.class);
    IntermediateEscalationEvent definition = node.getContent().getDefinition();
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new CancellingEscalationEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), new EscalationRef(EventDefinitionReader.escalationRefOf(e))));
    return Result.success(BpmnNode.of(node, p));
}
Also used : 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) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) CancellingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Edge(org.kie.workbench.common.stunner.core.graph.Edge) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Aggregations

CancellingEscalationEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet)6 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)5 IntermediateEscalationEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent)4 EscalationRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef)4 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 Test (org.junit.Test)2 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)2 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)2 CircleDimensionSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet)2 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)2 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)2 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)1 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1