Search in sources :

Example 16 with IntermediateSignalEventCatching

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching in project kie-wb-common by kiegroup.

the class BPMNDiagramMarshallerTest method testUnmarshallIntermediateSignalEventCatching.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateSignalEventCatching() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_SIGNAL_EVENTCATCHING);
    assertDiagram(diagram, 2);
    assertEquals("intermediateSignalCatching", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> intermediateEventNode = diagram.getGraph().getNode("_2C9B14A3-F663-476D-9FDF-31590D3A9CC5");
    IntermediateSignalEventCatching intermediateSignalEventCatching = (IntermediateSignalEventCatching) intermediateEventNode.getContent().getDefinition();
    assertNotNull(intermediateSignalEventCatching.getGeneral());
    assertEquals("MySignalCatchingEvent", intermediateSignalEventCatching.getGeneral().getName().getValue());
    assertEquals("MySignalCatchingEventDocumentation", intermediateSignalEventCatching.getGeneral().getDocumentation().getValue());
    assertNotNull(intermediateSignalEventCatching.getExecutionSet());
    assertEquals(true, intermediateSignalEventCatching.getExecutionSet().getCancelActivity().getValue());
    assertEquals("MySignal", intermediateSignalEventCatching.getExecutionSet().getSignalRef().getValue());
    DataIOSet dataIOSet = intermediateSignalEventCatching.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("||output1_:String||[dout]output1_->var1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 17 with IntermediateSignalEventCatching

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching in project kie-wb-common by kiegroup.

the class AbstractDataTypeCache method extractFromItem.

public void extractFromItem(View view) {
    Object definition = view.getDefinition();
    if (definition instanceof DataObject) {
        DataObject dataObject = (DataObject) definition;
        allDataTypes.add(dataObject.getType().getValue().getType());
    } else if (definition instanceof AdHocSubprocess) {
        AdHocSubprocess adhoc = (AdHocSubprocess) definition;
        allDataTypes.addAll(getDataTypes(adhoc.getProcessData().getProcessVariables().getValue()));
    } else if (definition instanceof BPMNDiagramImpl) {
        BPMNDiagramImpl diagram = (BPMNDiagramImpl) definition;
        allDataTypes.addAll(getDataTypes(diagram.getProcessData().getProcessVariables().getValue()));
    } else if (definition instanceof EmbeddedSubprocess) {
        EmbeddedSubprocess embeddedSubprocess = (EmbeddedSubprocess) definition;
        allDataTypes.addAll(getDataTypes(embeddedSubprocess.getProcessData().getProcessVariables().getValue()));
    } else if (definition instanceof EventSubprocess) {
        EventSubprocess eventSubprocess = (EventSubprocess) definition;
        allDataTypes.addAll(getDataTypes(eventSubprocess.getProcessData().getProcessVariables().getValue()));
    } else if (definition instanceof MultipleInstanceSubprocess) {
        MultipleInstanceSubprocess multipleInstanceSubprocess = (MultipleInstanceSubprocess) definition;
        allDataTypes.addAll(getDataTypes(multipleInstanceSubprocess.getProcessData().getProcessVariables().getValue()));
        allDataTypes.addAll(getDataTypes(multipleInstanceSubprocess.getExecutionSet().getMultipleInstanceDataInput().getValue()));
        allDataTypes.addAll(getDataTypes(multipleInstanceSubprocess.getExecutionSet().getMultipleInstanceDataOutput().getValue()));
    } else if (definition instanceof UserTask) {
        UserTask userTask = (UserTask) definition;
        allDataTypes.addAll(processAssignments(userTask.getExecutionSet().getAssignmentsinfo()));
    } else if (definition instanceof GenericServiceTask) {
        GenericServiceTask genericServiceTask = (GenericServiceTask) definition;
        allDataTypes.addAll(processAssignments(genericServiceTask.getExecutionSet().getAssignmentsinfo()));
    } else if (definition instanceof BusinessRuleTask) {
        BusinessRuleTask businessRuleTask = (BusinessRuleTask) definition;
        allDataTypes.addAll(processAssignments(businessRuleTask.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof EndErrorEvent) {
        EndErrorEvent endErrorEvent = (EndErrorEvent) definition;
        allDataTypes.addAll(processAssignments(endErrorEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof EndEscalationEvent) {
        EndEscalationEvent endEscalationEvent = (EndEscalationEvent) definition;
        allDataTypes.addAll(processAssignments(endEscalationEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof EndMessageEvent) {
        EndMessageEvent endMessageEvent = (EndMessageEvent) definition;
        allDataTypes.addAll(processAssignments(endMessageEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof EndSignalEvent) {
        EndSignalEvent endSignalEvent = (EndSignalEvent) definition;
        allDataTypes.addAll(processAssignments(endSignalEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateLinkEventCatching) {
        IntermediateLinkEventCatching intermediateLinkEventCatching = (IntermediateLinkEventCatching) definition;
        allDataTypes.addAll(processAssignments(intermediateLinkEventCatching.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateLinkEventThrowing) {
        IntermediateLinkEventThrowing intermediateLinkEventThrowing = (IntermediateLinkEventThrowing) definition;
        allDataTypes.addAll(processAssignments(intermediateLinkEventThrowing.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateErrorEventCatching) {
        IntermediateErrorEventCatching intermediateErrorEventCatching = (IntermediateErrorEventCatching) definition;
        allDataTypes.addAll(processAssignments(intermediateErrorEventCatching.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateEscalationEvent) {
        IntermediateEscalationEvent intermediateEscalationEvent = (IntermediateEscalationEvent) definition;
        allDataTypes.addAll(processAssignments(intermediateEscalationEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateEscalationEventThrowing) {
        IntermediateEscalationEventThrowing intermediateEscalationEventThrowing = (IntermediateEscalationEventThrowing) definition;
        allDataTypes.addAll(processAssignments(intermediateEscalationEventThrowing.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateMessageEventCatching) {
        IntermediateMessageEventCatching intermediateMessageEventCatching = (IntermediateMessageEventCatching) definition;
        allDataTypes.addAll(processAssignments(intermediateMessageEventCatching.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateMessageEventThrowing) {
        IntermediateMessageEventThrowing intermediateMessageEventThrowing = (IntermediateMessageEventThrowing) definition;
        allDataTypes.addAll(processAssignments(intermediateMessageEventThrowing.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateSignalEventCatching) {
        IntermediateSignalEventCatching intermediateSignalEventCatching = (IntermediateSignalEventCatching) definition;
        allDataTypes.addAll(processAssignments(intermediateSignalEventCatching.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof IntermediateSignalEventThrowing) {
        IntermediateSignalEventThrowing intermediateSignalEventThrowing = (IntermediateSignalEventThrowing) definition;
        allDataTypes.addAll(processAssignments(intermediateSignalEventThrowing.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof ReusableSubprocess) {
        ReusableSubprocess reusableSubprocess = (ReusableSubprocess) definition;
        allDataTypes.addAll(processAssignments(reusableSubprocess.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof StartErrorEvent) {
        StartErrorEvent startErrorEvent = (StartErrorEvent) definition;
        allDataTypes.addAll(processAssignments(startErrorEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof StartEscalationEvent) {
        StartEscalationEvent startEscalationEvent = (StartEscalationEvent) definition;
        allDataTypes.addAll(processAssignments(startEscalationEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof StartMessageEvent) {
        StartMessageEvent startMessageEvent = (StartMessageEvent) definition;
        allDataTypes.addAll(processAssignments(startMessageEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof StartSignalEvent) {
        StartSignalEvent startSignalEvent = (StartSignalEvent) definition;
        allDataTypes.addAll(processAssignments(startSignalEvent.getDataIOSet().getAssignmentsinfo()));
    } else if (definition instanceof CustomTask) {
        CustomTask customTask = (CustomTask) definition;
        allDataTypes.addAll(processAssignments(customTask.getDataIOSet().getAssignmentsinfo()));
    }
}
Also used : StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) GenericServiceTask(org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask) BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) AdHocSubprocess(org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess) EndEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent) StartEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent) MultipleInstanceSubprocess(org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess) IntermediateEscalationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEventThrowing) IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) EventSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) EmbeddedSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess) IntermediateMessageEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventThrowing) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) IntermediateSignalEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing) IntermediateLinkEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent) DataObject(org.kie.workbench.common.stunner.bpmn.definition.DataObject) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) DataObject(org.kie.workbench.common.stunner.bpmn.definition.DataObject) EndMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.EndMessageEvent) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) CustomTask(org.kie.workbench.common.stunner.bpmn.workitem.CustomTask)

Example 18 with IntermediateSignalEventCatching

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching in project kie-wb-common by kiegroup.

the class CatchingIntermediateSignalEventTest method testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() {
    Diagram<Graph, Metadata> diagram = getDiagram();
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    IntermediateSignalEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, TWO_OUTGOING_EDGES);
    assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertSignalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);
    assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 19 with IntermediateSignalEventCatching

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching in project kie-wb-common by kiegroup.

the class CatchingIntermediateSignalEventTest method testUnmarshallTopLevelEventWithEdgesEmptyProperties.

@Test
@Override
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() {
    Diagram<Graph, Metadata> diagram = getDiagram();
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    IntermediateSignalEventCatching emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, TWO_OUTGOING_EDGES);
    assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);
    assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 20 with IntermediateSignalEventCatching

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching in project kie-wb-common by kiegroup.

the class CatchingIntermediateSignalEventTest method testUnmarshallSubprocessLevelEventEmptyProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = getDiagram();
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    IntermediateSignalEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, ZERO_OUTGOING_EDGES);
    assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertSignalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);
    assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Aggregations

IntermediateSignalEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching)33 Test (org.junit.Test)24 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)18 Graph (org.kie.workbench.common.stunner.core.graph.Graph)18 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)5 CancellingSignalEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.CancellingSignalEventExecutionSet)5 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)4 SignalEventDefinition (org.eclipse.bpmn2.SignalEventDefinition)3 IntermediateMessageEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching)3 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)3 SignalRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef)3 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 IntermediateCatchEvent (org.eclipse.bpmn2.IntermediateCatchEvent)2 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)2 BaseCatchingIntermediateEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent)2 IntermediateConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent)2 IntermediateErrorEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching)2 IntermediateTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent)2 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)2 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)2