Search in sources :

Example 21 with Event

use of org.eclipse.bpmn2.Event in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverter method compensationEvent.

protected PropertyWriter compensationEvent(Node<View<IntermediateCompensationEventThrowing>, ?> n) {
    IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
    event.setId(n.getUUID());
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    IntermediateCompensationEventThrowing definition = n.getContent().getDefinition();
    p.setAbsoluteBounds(n);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    p.addCompensation();
    return p;
}
Also used : IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Example 22 with Event

use of org.eclipse.bpmn2.Event in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverter method escalationEvent.

protected PropertyWriter escalationEvent(Node<View<IntermediateEscalationEventThrowing>, ?> n) {
    IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
    event.setId(n.getUUID());
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    IntermediateEscalationEventThrowing definition = n.getContent().getDefinition();
    p.setAbsoluteBounds(n);
    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());
    return p;
}
Also used : EscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationEventExecutionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent) IntermediateEscalationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEventThrowing) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Example 23 with Event

use of org.eclipse.bpmn2.Event in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverter method linkEvent.

protected PropertyWriter linkEvent(Node<View<IntermediateLinkEventThrowing>, ?> n) {
    IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
    event.setId(n.getUUID());
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    IntermediateLinkEventThrowing definition = n.getContent().getDefinition();
    p.setAbsoluteBounds(n);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    LinkEventExecutionSet executionSet = definition.getExecutionSet();
    p.addLink(executionSet.getLinkRef());
    return p;
}
Also used : IntermediateLinkEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing) LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Example 24 with Event

use of org.eclipse.bpmn2.Event in project kie-wb-common by kiegroup.

the class AbstractThrowEventCompensationEventPostConverter method linkActivityRef.

protected void linkActivityRef(Process process, ThrowEvent throwEvent, String activityRef) {
    if (!isEmpty(activityRef)) {
        final CompensateEventDefinition compensateEvent = (CompensateEventDefinition) throwEvent.getEventDefinitions().get(0);
        final Activity activity = findActivity(process, activityRef);
        if (activity != null) {
            compensateEvent.setActivityRef(activity);
        } else {
            LOG.warn("Referred activity: " + activityRef + " was not found for event: id: " + throwEvent.getId() + ", name: " + throwEvent.getName());
        }
    }
}
Also used : Activity(org.eclipse.bpmn2.Activity) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition)

Example 25 with Event

use of org.eclipse.bpmn2.Event 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)

Aggregations

BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)28 Test (org.junit.Test)18 EventDefinition (org.eclipse.bpmn2.EventDefinition)15 CompensateEventDefinition (org.eclipse.bpmn2.CompensateEventDefinition)14 SignalEventDefinition (org.eclipse.bpmn2.SignalEventDefinition)14 ArrayList (java.util.ArrayList)13 List (java.util.List)13 ConditionalEventDefinition (org.eclipse.bpmn2.ConditionalEventDefinition)13 ErrorEventDefinition (org.eclipse.bpmn2.ErrorEventDefinition)13 EscalationEventDefinition (org.eclipse.bpmn2.EscalationEventDefinition)13 MessageEventDefinition (org.eclipse.bpmn2.MessageEventDefinition)13 ThrowEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)13 TimerEventDefinition (org.eclipse.bpmn2.TimerEventDefinition)12 Event (io.requery.test.model3.Event)9 UUID (java.util.UUID)9 EndEvent (org.eclipse.bpmn2.EndEvent)9 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)9 CatchEvent (org.eclipse.bpmn2.CatchEvent)8 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)8 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)8