Search in sources :

Example 6 with TerminateEventDefinition

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

the class EndEventJsonConverter method convertJsonToElement.

protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    EndEvent endEvent = new EndEvent();
    String stencilId = BpmnJsonConverterUtil.getStencilId(elementNode);
    if (STENCIL_EVENT_END_ERROR.equals(stencilId)) {
        convertJsonToErrorDefinition(elementNode, endEvent);
    } else if (STENCIL_EVENT_END_CANCEL.equals(stencilId)) {
        CancelEventDefinition eventDefinition = new CancelEventDefinition();
        endEvent.getEventDefinitions().add(eventDefinition);
    } else if (STENCIL_EVENT_END_TERMINATE.equals(stencilId)) {
        TerminateEventDefinition eventDefinition = new TerminateEventDefinition();
        String terminateAllStringValue = getPropertyValueAsString(PROPERTY_TERMINATE_ALL, elementNode);
        if (StringUtils.isNotEmpty(terminateAllStringValue)) {
            eventDefinition.setTerminateAll("true".equals(terminateAllStringValue));
        }
        String terminateMiStringValue = getPropertyValueAsString(PROPERTY_TERMINATE_MULTI_INSTANCE, elementNode);
        if (StringUtils.isNotEmpty(terminateMiStringValue)) {
            eventDefinition.setTerminateMultiInstance("true".equals(terminateMiStringValue));
        }
        endEvent.getEventDefinitions().add(eventDefinition);
    }
    return endEvent;
}
Also used : EndEvent(org.activiti.bpmn.model.EndEvent) CancelEventDefinition(org.activiti.bpmn.model.CancelEventDefinition) TerminateEventDefinition(org.activiti.bpmn.model.TerminateEventDefinition)

Aggregations

TerminateEventDefinition (org.activiti.bpmn.model.TerminateEventDefinition)6 CancelEventDefinition (org.activiti.bpmn.model.CancelEventDefinition)3 EndEvent (org.activiti.bpmn.model.EndEvent)3 ErrorEventDefinition (org.activiti.bpmn.model.ErrorEventDefinition)3 EventDefinition (org.activiti.bpmn.model.EventDefinition)3 MessageEventDefinition (org.activiti.bpmn.model.MessageEventDefinition)2 BpmnModel (org.activiti.bpmn.model.BpmnModel)1 Error (org.activiti.bpmn.model.Error)1 Message (org.activiti.bpmn.model.Message)1 SignalEventDefinition (org.activiti.bpmn.model.SignalEventDefinition)1 TimerEventDefinition (org.activiti.bpmn.model.TimerEventDefinition)1 TerminateEndEventActivityBehavior (org.activiti.engine.impl.bpmn.behavior.TerminateEndEventActivityBehavior)1