Search in sources :

Example 1 with EndEscalationEvent

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

the class EndEventConverter method escalationEvent.

private PropertyWriter escalationEvent(Node<View<EndEscalationEvent>, ?> n) {
    EndEvent event = bpmn2.createEndEvent();
    event.setId(n.getUUID());
    EndEscalationEvent 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());
    EscalationEventExecutionSet executionSet = definition.getExecutionSet();
    p.addEscalation(executionSet.getEscalationRef());
    p.setAbsoluteBounds(n);
    return p;
}
Also used : EscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationEventExecutionSet) BaseEndEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent) EndEvent(org.eclipse.bpmn2.EndEvent) EndEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Example 2 with EndEscalationEvent

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

the class VariableUtilsTest method mockEndEscalationEvent.

private EndEscalationEvent mockEndEscalationEvent(String name, String assignmentsInfoValue) {
    EndEscalationEvent result = mockEndEvent(name, EndEscalationEvent.class);
    AssignmentsInfo assignmentsInfo = mockAssignmentsInfo(assignmentsInfoValue);
    DataIOSet dataIOSet = mockIOSet(assignmentsInfo);
    when(result.getDataIOSet()).thenReturn(dataIOSet);
    return result;
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) EndEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent)

Example 3 with EndEscalationEvent

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

the class EventSubProcessPostConverterTest method setUp.

@Before
@SuppressWarnings("unchecked")
public void setUp() {
    when(nodeWriter.getElement()).thenReturn(subProcess);
    outEdges = new ArrayList<>();
    outEdges.add(mockEdge(mock(Node.class), newNode(new IntermediateTimerEvent())));
    outEdges.add(mockEdge(mock(Node.class), newNode(new UserTask())));
    outEdges.add(mockEdge(mock(Node.class), newNode(new ScriptTask())));
    outEdges.add(mockEdge(mock(Node.class), newNode(new IntermediateSignalEventThrowing())));
    outEdges.add(mockEdge(mock(Node.class), newNode(new EmbeddedSubprocess())));
    outEdges.add(mockEdge(mock(Node.class), newNode(new EndEscalationEvent())));
    when(eventSubprocessNode.getOutEdges()).thenReturn(outEdges);
    converter = new EventSubProcessPostConverter();
}
Also used : ScriptTask(org.kie.workbench.common.stunner.bpmn.definition.ScriptTask) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) EmbeddedSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess) EndEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent) IntermediateSignalEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing) Before(org.junit.Before)

Example 4 with EndEscalationEvent

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

the class AbstractDataTypeCacheTest method testExtractEndEscalationEvent.

@Test
public void testExtractEndEscalationEvent() {
    EndEscalationEvent endEscalationEvent = new EndEscalationEvent();
    EndEscalationEvent endEscalationEvent2 = new EndEscalationEvent();
    when(firstView.getDefinition()).thenReturn(endEscalationEvent);
    when(lastView.getDefinition()).thenReturn(endEscalationEvent2);
    dataTypeCache.extractFromItem(firstView);
    dataTypeCache.extractFromItem(lastView);
    assertTrue(dataTypeCache.allDataTypes.contains("MyType"));
    assertTrue(dataTypeCache.allDataTypes.contains("com.myspace.Person"));
}
Also used : EndEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent) Test(org.junit.Test)

Example 5 with EndEscalationEvent

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallEndEscalationEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndEscalationEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDESCALATIONEVENT);
    assertDiagram(diagram, 2);
    assertEquals("EndEscalationEvent", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_8F6A4096-26AA-4C14-B1F0-B96ED24BD5C7");
    assertNotNull(endEventNode);
    EndEscalationEvent endEscalationEvent = (EndEscalationEvent) endEventNode.getContent().getDefinition();
    assertNotNull(endEscalationEvent.getGeneral());
    assertEquals("EndEscalationEventName", endEscalationEvent.getGeneral().getName().getValue());
    assertEquals("EndEscalationEventDocumentation", endEscalationEvent.getGeneral().getDocumentation().getValue());
    assertNotNull(endEscalationEvent.getExecutionSet());
    assertEquals("EscalationCode", endEscalationEvent.getExecutionSet().getEscalationRef().getValue());
    DataIOSet dataIOSet = endEscalationEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("escalationInput:String||||[din]processVar1->escalationInput", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) EndEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent) Test(org.junit.Test)

Aggregations

EndEscalationEvent (org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent)16 Test (org.junit.Test)10 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)9 Graph (org.kie.workbench.common.stunner.core.graph.Graph)9 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)3 EscalationEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationEventExecutionSet)3 EmbeddedSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess)2 IntermediateSignalEventThrowing (org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing)2 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)2 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 EscalationRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 EndEvent (org.eclipse.bpmn2.EndEvent)1 Before (org.junit.Before)1 ParsedAssignmentsInfo (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo)1 ThrowEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)1 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)1 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)1 AdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess)1 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)1