use of org.activiti.bpmn.model.EndEvent in project Activiti by Activiti.
the class EndEventXMLConverter method convertXMLToElement.
@Override
protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception {
EndEvent endEvent = new EndEvent();
BpmnXMLUtil.addXMLLocation(endEvent, xtr);
parseChildElements(getXMLElementName(), endEvent, model, xtr);
return endEvent;
}
use of org.activiti.bpmn.model.EndEvent in project Activiti by Activiti.
the class EndEventXMLConverter method writeAdditionalChildElements.
@Override
protected void writeAdditionalChildElements(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception {
EndEvent endEvent = (EndEvent) element;
writeEventDefinitions(endEvent, endEvent.getEventDefinitions(), model, xtw);
}
use of org.activiti.bpmn.model.EndEvent in project Activiti by Activiti.
the class TerminateEventDefinitionParser method parseChildElement.
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof EndEvent == false)
return;
TerminateEventDefinition eventDefinition = new TerminateEventDefinition();
String terminateAllValue = xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TERMINATE_ALL);
if (terminateAllValue != null && "true".equals(terminateAllValue)) {
eventDefinition.setTerminateAll(true);
} else {
eventDefinition.setTerminateAll(false);
}
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
BpmnXMLUtil.parseChildElements(ELEMENT_EVENT_TERMINATEDEFINITION, eventDefinition, xtr, model);
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
use of org.activiti.bpmn.model.EndEvent in project Activiti by Activiti.
the class AbstractActivitiTestCase method createTwoTasksTestProcess.
public BpmnModel createTwoTasksTestProcess() {
BpmnModel model = new BpmnModel();
org.activiti.bpmn.model.Process process = new org.activiti.bpmn.model.Process();
model.addProcess(process);
process.setId("twoTasksProcess");
process.setName("The two tasks process");
StartEvent startEvent = new StartEvent();
startEvent.setId("start");
process.addFlowElement(startEvent);
UserTask userTask = new UserTask();
userTask.setName("The First Task");
userTask.setId("task1");
userTask.setAssignee("kermit");
process.addFlowElement(userTask);
UserTask userTask2 = new UserTask();
userTask2.setName("The Second Task");
userTask2.setId("task2");
userTask2.setAssignee("kermit");
process.addFlowElement(userTask2);
EndEvent endEvent = new EndEvent();
endEvent.setId("theEnd");
process.addFlowElement(endEvent);
process.addFlowElement(new SequenceFlow("start", "task1"));
process.addFlowElement(new SequenceFlow("start", "task2"));
process.addFlowElement(new SequenceFlow("task1", "theEnd"));
process.addFlowElement(new SequenceFlow("task2", "theEnd"));
return model;
}
use of org.activiti.bpmn.model.EndEvent in project Activiti by Activiti.
the class AsyncEndEventConverterTest method validateModel.
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("endEvent");
assertNotNull(flowElement);
assertTrue(flowElement instanceof EndEvent);
assertEquals("endEvent", flowElement.getId());
EndEvent endEvent = (EndEvent) flowElement;
assertEquals("endEvent", endEvent.getId());
assertTrue(endEvent.isAsynchronous());
List<ActivitiListener> listeners = endEvent.getExecutionListeners();
assertEquals(1, listeners.size());
ActivitiListener listener = listeners.get(0);
assertTrue(ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(listener.getImplementationType()));
assertEquals("org.test.TestClass", listener.getImplementation());
assertEquals("start", listener.getEvent());
}
Aggregations