Search in sources :

Example 16 with EventDefinition

use of org.activiti.bpmn.model.EventDefinition in project Activiti by Activiti.

the class BpmnModelUtil method createSignalThrowEvent.

public static ThrowEvent createSignalThrowEvent(WorkflowDefinitionConversion conversion, Signal approvalFinishedSignal) {
    SignalEventDefinition signalEventDefinition = new SignalEventDefinition();
    signalEventDefinition.setSignalRef(approvalFinishedSignal.getId());
    List<EventDefinition> signalEventDefinitions = new ArrayList<EventDefinition>();
    signalEventDefinitions.add(signalEventDefinition);
    ThrowEvent signalThrowEvent = new ThrowEvent();
    signalThrowEvent.setId(conversion.getUniqueNumberedId(SIGNAL_THROWEVENT_PREFIX));
    signalThrowEvent.setEventDefinitions(signalEventDefinitions);
    return signalThrowEvent;
}
Also used : ThrowEvent(org.activiti.bpmn.model.ThrowEvent) ArrayList(java.util.ArrayList) SignalEventDefinition(org.activiti.bpmn.model.SignalEventDefinition) SignalEventDefinition(org.activiti.bpmn.model.SignalEventDefinition) EventDefinition(org.activiti.bpmn.model.EventDefinition)

Example 17 with EventDefinition

use of org.activiti.bpmn.model.EventDefinition in project Activiti by Activiti.

the class EndEventJsonConverter method getStencilId.

protected String getStencilId(BaseElement baseElement) {
    EndEvent endEvent = (EndEvent) baseElement;
    List<EventDefinition> eventDefinitions = endEvent.getEventDefinitions();
    if (eventDefinitions.size() != 1) {
        return STENCIL_EVENT_END_NONE;
    }
    EventDefinition eventDefinition = eventDefinitions.get(0);
    if (eventDefinition instanceof ErrorEventDefinition) {
        return STENCIL_EVENT_END_ERROR;
    } else if (eventDefinition instanceof CancelEventDefinition) {
        return STENCIL_EVENT_END_CANCEL;
    } else if (eventDefinition instanceof TerminateEventDefinition) {
        return STENCIL_EVENT_END_TERMINATE;
    } else {
        return STENCIL_EVENT_END_NONE;
    }
}
Also used : ErrorEventDefinition(org.activiti.bpmn.model.ErrorEventDefinition) EndEvent(org.activiti.bpmn.model.EndEvent) CancelEventDefinition(org.activiti.bpmn.model.CancelEventDefinition) TerminateEventDefinition(org.activiti.bpmn.model.TerminateEventDefinition) TerminateEventDefinition(org.activiti.bpmn.model.TerminateEventDefinition) ErrorEventDefinition(org.activiti.bpmn.model.ErrorEventDefinition) CancelEventDefinition(org.activiti.bpmn.model.CancelEventDefinition) EventDefinition(org.activiti.bpmn.model.EventDefinition)

Example 18 with EventDefinition

use of org.activiti.bpmn.model.EventDefinition in project Activiti by Activiti.

the class ThrowEventJsonConverter method getStencilId.

protected String getStencilId(BaseElement baseElement) {
    ThrowEvent throwEvent = (ThrowEvent) baseElement;
    List<EventDefinition> eventDefinitions = throwEvent.getEventDefinitions();
    if (eventDefinitions.size() != 1) {
        // return none event as default;
        return STENCIL_EVENT_THROW_NONE;
    }
    EventDefinition eventDefinition = eventDefinitions.get(0);
    if (eventDefinition instanceof SignalEventDefinition) {
        return STENCIL_EVENT_THROW_SIGNAL;
    } else {
        return STENCIL_EVENT_THROW_NONE;
    }
}
Also used : ThrowEvent(org.activiti.bpmn.model.ThrowEvent) SignalEventDefinition(org.activiti.bpmn.model.SignalEventDefinition) SignalEventDefinition(org.activiti.bpmn.model.SignalEventDefinition) EventDefinition(org.activiti.bpmn.model.EventDefinition)

Aggregations

EventDefinition (org.activiti.bpmn.model.EventDefinition)18 SignalEventDefinition (org.activiti.bpmn.model.SignalEventDefinition)13 MessageEventDefinition (org.activiti.bpmn.model.MessageEventDefinition)10 TimerEventDefinition (org.activiti.bpmn.model.TimerEventDefinition)8 FlowElement (org.activiti.bpmn.model.FlowElement)6 CancelEventDefinition (org.activiti.bpmn.model.CancelEventDefinition)5 ErrorEventDefinition (org.activiti.bpmn.model.ErrorEventDefinition)5 BoundaryEvent (org.activiti.bpmn.model.BoundaryEvent)4 ActivityImpl (org.activiti.engine.impl.pvm.process.ActivityImpl)4 IntermediateCatchEvent (org.activiti.bpmn.model.IntermediateCatchEvent)3 SequenceFlow (org.activiti.bpmn.model.SequenceFlow)3 TerminateEventDefinition (org.activiti.bpmn.model.TerminateEventDefinition)3 ScopeImpl (org.activiti.engine.impl.pvm.process.ScopeImpl)3 CompensateEventDefinition (org.activiti.bpmn.model.CompensateEventDefinition)2 Event (org.activiti.bpmn.model.Event)2 Message (org.activiti.bpmn.model.Message)2 Signal (org.activiti.bpmn.model.Signal)2 ThrowEvent (org.activiti.bpmn.model.ThrowEvent)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ArrayList (java.util.ArrayList)1