Search in sources :

Example 6 with ThrowEvent

use of org.activiti.bpmn.model.ThrowEvent 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 7 with ThrowEvent

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

the class FeedbackStepDefinitionConverter method createSignalThrow.

protected ThrowEvent createSignalThrow(WorkflowDefinitionConversion conversion, Signal signal) {
    ThrowEvent signalThrowEvent = new ThrowEvent();
    signalThrowEvent.setId(conversion.getUniqueNumberedId(ConversionConstants.EVENT_ID_PREFIX));
    SignalEventDefinition signalThrowEventDefinition = new SignalEventDefinition();
    signalThrowEventDefinition.setSignalRef(signal.getId());
    signalThrowEvent.addEventDefinition(signalThrowEventDefinition);
    addFlowElement(conversion, signalThrowEvent);
    return signalThrowEvent;
}
Also used : ThrowEvent(org.activiti.bpmn.model.ThrowEvent) SignalEventDefinition(org.activiti.bpmn.model.SignalEventDefinition)

Example 8 with ThrowEvent

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

the class ThrowEventJsonConverter method convertJsonToElement.

protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    ThrowEvent throwEvent = new ThrowEvent();
    String stencilId = BpmnJsonConverterUtil.getStencilId(elementNode);
    if (STENCIL_EVENT_THROW_SIGNAL.equals(stencilId)) {
        convertJsonToSignalDefinition(elementNode, throwEvent);
    }
    return throwEvent;
}
Also used : ThrowEvent(org.activiti.bpmn.model.ThrowEvent)

Example 9 with ThrowEvent

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

the class ThrowEventJsonConverter method convertElementToJson.

protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) {
    ThrowEvent throwEvent = (ThrowEvent) baseElement;
    addEventProperties(throwEvent, propertiesNode);
}
Also used : ThrowEvent(org.activiti.bpmn.model.ThrowEvent)

Example 10 with ThrowEvent

use of org.activiti.bpmn.model.ThrowEvent 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

ThrowEvent (org.activiti.bpmn.model.ThrowEvent)10 BoundaryEvent (org.activiti.bpmn.model.BoundaryEvent)3 SignalEventDefinition (org.activiti.bpmn.model.SignalEventDefinition)3 EventDefinition (org.activiti.bpmn.model.EventDefinition)2 Signal (org.activiti.bpmn.model.Signal)2 ActivityImpl (org.activiti.engine.impl.pvm.process.ActivityImpl)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 BaseElement (org.activiti.bpmn.model.BaseElement)1 CompensateEventDefinition (org.activiti.bpmn.model.CompensateEventDefinition)1 ExclusiveGateway (org.activiti.bpmn.model.ExclusiveGateway)1 IntermediateCatchEvent (org.activiti.bpmn.model.IntermediateCatchEvent)1 ParallelGateway (org.activiti.bpmn.model.ParallelGateway)1 StartEvent (org.activiti.bpmn.model.StartEvent)1 UserTask (org.activiti.bpmn.model.UserTask)1 EventSubscriptionDeclaration (org.activiti.engine.impl.bpmn.parser.EventSubscriptionDeclaration)1 ScopeImpl (org.activiti.engine.impl.pvm.process.ScopeImpl)1