use of org.activiti.bpmn.model.EndEvent in project Activiti by Activiti.
the class TestProcessUtil method createOneTaskProcess.
public static org.activiti.bpmn.model.Process createOneTaskProcess() {
org.activiti.bpmn.model.Process process = new org.activiti.bpmn.model.Process();
process.setId("oneTaskProcess");
process.setName("The one task process");
StartEvent startEvent = new StartEvent();
startEvent.setId("start");
process.addFlowElement(startEvent);
UserTask userTask = new UserTask();
userTask.setName("The Task");
userTask.setId("theTask");
userTask.setAssignee("kermit");
process.addFlowElement(userTask);
EndEvent endEvent = new EndEvent();
endEvent.setId("theEnd");
process.addFlowElement(endEvent);
process.addFlowElement(new SequenceFlow("start", "theTask"));
process.addFlowElement(new SequenceFlow("theTask", "theEnd"));
return process;
}
use of org.activiti.bpmn.model.EndEvent in project Activiti by Activiti.
the class EndEventJsonConverter method convertElementToJson.
protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) {
EndEvent endEvent = (EndEvent) baseElement;
addEventProperties(endEvent, propertiesNode);
}
use of org.activiti.bpmn.model.EndEvent 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.EndEvent 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;
}
Aggregations