use of org.activiti.bpmn.model.Activity in project Activiti by Activiti.
the class AbstractBpmnParseHandler method createActivityOnScope.
public ActivityImpl createActivityOnScope(BpmnParse bpmnParse, FlowElement flowElement, String xmlLocalName, ScopeImpl scopeElement) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Parsing activity {}", flowElement.getId());
}
ActivityImpl activity = scopeElement.createActivity(flowElement.getId());
bpmnParse.setCurrentActivity(activity);
activity.setProperty("name", flowElement.getName());
activity.setProperty("documentation", flowElement.getDocumentation());
if (flowElement instanceof Activity) {
Activity modelActivity = (Activity) flowElement;
activity.setProperty("default", modelActivity.getDefaultFlow());
if (modelActivity.isForCompensation()) {
activity.setProperty(PROPERTYNAME_IS_FOR_COMPENSATION, true);
}
} else if (flowElement instanceof Gateway) {
activity.setProperty("default", ((Gateway) flowElement).getDefaultFlow());
}
activity.setProperty("type", xmlLocalName);
return activity;
}
use of org.activiti.bpmn.model.Activity in project Activiti by Activiti.
the class DataOutputAssociationParser method parseChildElement.
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (!(parentElement instanceof Activity)) {
return;
}
DataAssociation dataAssociation = new DataAssociation();
BpmnXMLUtil.addXMLLocation(dataAssociation, xtr);
DataAssociationParser.parseDataAssociation(dataAssociation, getElementName(), xtr);
((Activity) parentElement).getDataOutputAssociations().add(dataAssociation);
}
use of org.activiti.bpmn.model.Activity in project Activiti by Activiti.
the class MultiInstanceParser method parseChildElement.
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (!(parentElement instanceof Activity)) {
return;
}
MultiInstanceLoopCharacteristics multiInstanceDef = new MultiInstanceLoopCharacteristics();
BpmnXMLUtil.addXMLLocation(multiInstanceDef, xtr);
parseMultiInstanceProperties(xtr, multiInstanceDef);
((Activity) parentElement).setLoopCharacteristics(multiInstanceDef);
}
use of org.activiti.bpmn.model.Activity in project Activiti by Activiti.
the class ActivitiMapExceptionParser method parseChildElement.
@Override
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (!(parentElement instanceof Activity))
return;
String errorCode = xtr.getAttributeValue(null, MAP_EXCEPTION_ERRORCODE);
String andChildren = xtr.getAttributeValue(null, MAP_EXCEPTION_ANDCHILDREN);
String exceptionClass = xtr.getElementText();
boolean hasChildrenBool = false;
if (StringUtils.isEmpty(andChildren) || andChildren.toLowerCase().equals("false")) {
hasChildrenBool = false;
} else if (andChildren.toLowerCase().equals("true")) {
hasChildrenBool = true;
} else {
throw new XMLException("'" + andChildren + "' is not valid boolean in mapException with errorCode=" + errorCode + " and class=" + exceptionClass);
}
if (StringUtils.isEmpty(errorCode) || StringUtils.isEmpty(errorCode.trim())) {
throw new XMLException("No errorCode defined mapException with errorCode=" + errorCode + " and class=" + exceptionClass);
}
((Activity) parentElement).getMapExceptions().add(new MapExceptionEntry(errorCode, exceptionClass, hasChildrenBool));
}
use of org.activiti.bpmn.model.Activity in project Activiti by Activiti.
the class DataInputAssociationParser method parseChildElement.
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (!(parentElement instanceof Activity)) {
return;
}
DataAssociation dataAssociation = new DataAssociation();
BpmnXMLUtil.addXMLLocation(dataAssociation, xtr);
DataAssociationParser.parseDataAssociation(dataAssociation, getElementName(), xtr);
((Activity) parentElement).getDataInputAssociations().add(dataAssociation);
}
Aggregations