Search in sources :

Example 6 with StartMessageEvent

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

the class ProcessMessageRefProviderTest method mockStartMessageEventNode.

private Element mockStartMessageEventNode(String messageRefValue) {
    StartMessageEvent event = new StartMessageEvent();
    event.setExecutionSet(new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new SLADueDate(), new MessageRef(messageRefValue, "")));
    return mockNode(event);
}
Also used : SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) InterruptingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)

Example 7 with StartMessageEvent

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

the class BPMNDiagramMarshallerTest method testUnmarshallStartMessageEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartMessageEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTMESSAGEEVENT);
    assertDiagram(diagram, 2);
    assertEquals("StartMessageEvent", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> startMessageEventNode = diagram.getGraph().getNode("_34C4BBFC-544F-4E23-B17B-547BB48EEB63");
    StartMessageEvent startMessageEvent = (StartMessageEvent) startMessageEventNode.getContent().getDefinition();
    assertNotNull(startMessageEvent.getExecutionSet());
    MessageRef messageRef = startMessageEvent.getExecutionSet().getMessageRef();
    IsInterrupting isInterrupting = startMessageEvent.getExecutionSet().getIsInterrupting();
    assertEquals("msgref", messageRef.getValue());
    assertEquals(true, isInterrupting.getValue());
    DataIOSet dataIOSet = startMessageEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("||StartMessageEventOutputVar1:String||[dout]StartMessageEventOutputVar1->var1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) Graph(org.kie.workbench.common.stunner.core.graph.Graph) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) Test(org.junit.Test)

Example 8 with StartMessageEvent

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

the class BPMNDiagramMarshallerTest method testUnmarshallIsInterruptingStartMessageEvent.

@Test
public void testUnmarshallIsInterruptingStartMessageEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTMESSAGEEVENT);
    assertDiagram(diagram, 7);
    assertEquals("EventSubprocessStartMessageEvent", diagram.getMetadata().getTitle());
    // Check first start event with all FILLED properties
    Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("_77E79714-F32A-4BE7-B0D2-15178F5244F0");
    StartMessageEvent startMessageEvent = (StartMessageEvent) startEventNode.getContent().getDefinition();
    BPMNGeneralSet eventGeneralSet = startMessageEvent.getGeneral();
    assertNotNull(eventGeneralSet);
    assertEquals("StartMessageEvent", eventGeneralSet.getName().getValue());
    assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
    InterruptingMessageEventExecutionSet eventExecutionSet = startMessageEvent.getExecutionSet();
    assertNotNull(eventExecutionSet);
    assertNotNull(eventExecutionSet.getMessageRef());
    assertEquals("Message1", eventExecutionSet.getMessageRef().getValue());
    assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
    DataIOSet eventDataIOSet = startMessageEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
    assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
    // Check second start event with all EMPTY properties
    Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("_E4563AE4-5F70-4283-A5AC-C9AB14F15EBA");
    StartMessageEvent emptyMessageEvent = (StartMessageEvent) emptyEventNode.getContent().getDefinition();
    BPMNGeneralSet emptyEventGeneralSet = emptyMessageEvent.getGeneral();
    assertNotNull(emptyEventGeneralSet);
    assertEquals("", emptyEventGeneralSet.getName().getValue());
    assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
    InterruptingMessageEventExecutionSet emptyExecutionSet = emptyMessageEvent.getExecutionSet();
    assertNotNull(emptyExecutionSet);
    assertNotNull(emptyExecutionSet.getMessageRef());
    assertEquals("", emptyExecutionSet.getMessageRef().getValue());
    assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
    DataIOSet emptyDataIOSet = emptyMessageEvent.getDataIOSet();
    AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
    assertEquals("", emptyAssignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) Graph(org.kie.workbench.common.stunner.core.graph.Graph) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) InterruptingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet) Test(org.junit.Test)

Example 9 with StartMessageEvent

use of org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent 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 10 with StartMessageEvent

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

the class EventInterruptingViewHandlerTest method testHandleMessageEventIsNotInterrupting.

@Test
@SuppressWarnings("unchecked")
public void testHandleMessageEventIsNotInterrupting() {
    final StartMessageEvent bean = new StartMessageEvent();
    bean.getExecutionSet().getIsInterrupting().setValue(false);
    tested.handle(bean, view);
    verify(prim1).setFillAlpha(eq(0d));
    verify(prim1).setStrokeAlpha(eq(1d));
}
Also used : StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) Test(org.junit.Test)

Aggregations

StartMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent)17 Test (org.junit.Test)12 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)7 Graph (org.kie.workbench.common.stunner.core.graph.Graph)7 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)5 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)4 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)4 InterruptingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet)4 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)3 StartEscalationEvent (org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent)3 StartSignalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent)3 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)3 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 StartConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent)2 StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)2 StartTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent)2 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)2 StartEvent (org.eclipse.bpmn2.StartEvent)1 ParsedAssignmentsInfo (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo)1 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)1