Search in sources :

Example 1 with Activity

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;
}
Also used : ActivityImpl(org.activiti.engine.impl.pvm.process.ActivityImpl) Gateway(org.activiti.bpmn.model.Gateway) EventGateway(org.activiti.bpmn.model.EventGateway) Activity(org.activiti.bpmn.model.Activity)

Example 2 with 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);
}
Also used : DataAssociation(org.activiti.bpmn.model.DataAssociation) Activity(org.activiti.bpmn.model.Activity)

Example 3 with Activity

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);
}
Also used : MultiInstanceLoopCharacteristics(org.activiti.bpmn.model.MultiInstanceLoopCharacteristics) Activity(org.activiti.bpmn.model.Activity)

Example 4 with Activity

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));
}
Also used : XMLException(org.activiti.bpmn.exceptions.XMLException) Activity(org.activiti.bpmn.model.Activity) MapExceptionEntry(org.activiti.bpmn.model.MapExceptionEntry)

Example 5 with Activity

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);
}
Also used : DataAssociation(org.activiti.bpmn.model.DataAssociation) Activity(org.activiti.bpmn.model.Activity)

Aggregations

Activity (org.activiti.bpmn.model.Activity)27 FlowElement (org.activiti.bpmn.model.FlowElement)17 SequenceFlow (org.activiti.bpmn.model.SequenceFlow)11 SubProcess (org.activiti.bpmn.model.SubProcess)9 BoundaryEvent (org.activiti.bpmn.model.BoundaryEvent)8 FlowNode (org.activiti.bpmn.model.FlowNode)8 Gateway (org.activiti.bpmn.model.Gateway)8 MultiInstanceLoopCharacteristics (org.activiti.bpmn.model.MultiInstanceLoopCharacteristics)6 Process (org.activiti.bpmn.model.Process)6 ExecutionEntity (org.activiti.engine.impl.persistence.entity.ExecutionEntity)5 GraphicInfo (org.activiti.bpmn.model.GraphicInfo)4 ArrayList (java.util.ArrayList)3 Artifact (org.activiti.bpmn.model.Artifact)3 CallActivity (org.activiti.bpmn.model.CallActivity)3 DataAssociation (org.activiti.bpmn.model.DataAssociation)3 EventGateway (org.activiti.bpmn.model.EventGateway)3 EventSubProcess (org.activiti.bpmn.model.EventSubProcess)3 ExclusiveGateway (org.activiti.bpmn.model.ExclusiveGateway)3 FlowElementsContainer (org.activiti.bpmn.model.FlowElementsContainer)3 ActivitiException (org.activiti.engine.ActivitiException)3