Search in sources :

Example 6 with CancelEventDefinition

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

the class CancelEventDefinitionParser method parseChildElement.

public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
    if (parentElement instanceof Event == false)
        return;
    CancelEventDefinition eventDefinition = new CancelEventDefinition();
    BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
    ((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
Also used : Event(org.activiti.bpmn.model.Event) CancelEventDefinition(org.activiti.bpmn.model.CancelEventDefinition)

Example 7 with CancelEventDefinition

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

use of org.activiti.bpmn.model.CancelEventDefinition 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));
        }
        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

CancelEventDefinition (org.activiti.bpmn.model.CancelEventDefinition)8 EventDefinition (org.activiti.bpmn.model.EventDefinition)5 BoundaryEvent (org.activiti.bpmn.model.BoundaryEvent)3 CompensateEventDefinition (org.activiti.bpmn.model.CompensateEventDefinition)3 ErrorEventDefinition (org.activiti.bpmn.model.ErrorEventDefinition)3 MessageEventDefinition (org.activiti.bpmn.model.MessageEventDefinition)3 SignalEventDefinition (org.activiti.bpmn.model.SignalEventDefinition)3 TerminateEventDefinition (org.activiti.bpmn.model.TerminateEventDefinition)3 EndEvent (org.activiti.bpmn.model.EndEvent)2 TimerEventDefinition (org.activiti.bpmn.model.TimerEventDefinition)2 ActivityImpl (org.activiti.engine.impl.pvm.process.ActivityImpl)2 HashMap (java.util.HashMap)1 Event (org.activiti.bpmn.model.Event)1 FlowElement (org.activiti.bpmn.model.FlowElement)1 Transaction (org.activiti.bpmn.model.Transaction)1 ScopeImpl (org.activiti.engine.impl.pvm.process.ScopeImpl)1