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);
}
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;
}
}
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;
}
Aggregations