Search in sources :

Example 11 with Definitions

use of org.jbpm.bpmn2.core.Definitions in project jbpm by kiegroup.

the class XmlBPMNProcessDumper method visitErrors.

protected void visitErrors(Definitions definitions, StringBuilder xmlDump) {
    if (definitions == null) {
        return;
    }
    List<Error> errors = definitions.getErrors();
    if (errors == null || errors.isEmpty()) {
        return;
    }
    for (org.jbpm.bpmn2.core.Error error : errors) {
        String id = XmlBPMNProcessDumper.replaceIllegalCharsAttribute(error.getId());
        String code = error.getErrorCode();
        xmlDump.append("  <error id=\"" + id + "\"");
        if (error.getErrorCode() != null) {
            code = XmlBPMNProcessDumper.replaceIllegalCharsAttribute(code);
            xmlDump.append(" errorCode=\"" + code + "\"");
        }
        String structureRef = error.getStructureRef();
        if (structureRef != null) {
            structureRef = XmlBPMNProcessDumper.replaceIllegalCharsAttribute(structureRef);
            xmlDump.append(" structureRef=\"" + structureRef + "\"");
        }
        xmlDump.append("/>" + EOL);
    }
}
Also used : Error(org.jbpm.bpmn2.core.Error) Error(org.jbpm.bpmn2.core.Error)

Example 12 with Definitions

use of org.jbpm.bpmn2.core.Definitions in project jbpm by kiegroup.

the class ProcessHandler method end.

@SuppressWarnings("unchecked")
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
    parser.endElementBuilder();
    RuleFlowProcess process = (RuleFlowProcess) parser.getCurrent();
    List<IntermediateLink> throwLinks = (List<IntermediateLink>) process.getMetaData(LINKS);
    linkIntermediateLinks(process, throwLinks);
    List<SequenceFlow> connections = (List<SequenceFlow>) process.getMetaData(CONNECTIONS);
    linkConnections(process, connections);
    linkBoundaryEvents(process);
    // This must be done *after* linkConnections(process, connections)
    // because it adds hidden connections for compensations
    List<Association> associations = (List<Association>) process.getMetaData(ASSOCIATIONS);
    linkAssociations((Definitions) process.getMetaData("Definitions"), process, associations);
    List<Lane> lanes = (List<Lane>) process.getMetaData(LaneHandler.LANES);
    assignLanes(process, lanes);
    postProcessNodes(process, process);
    return process;
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) Association(org.jbpm.bpmn2.core.Association) SequenceFlow(org.jbpm.bpmn2.core.SequenceFlow) Lane(org.jbpm.bpmn2.core.Lane) List(java.util.List) ArrayList(java.util.ArrayList) IntermediateLink(org.jbpm.bpmn2.core.IntermediateLink)

Aggregations

List (java.util.List)6 Association (org.jbpm.bpmn2.core.Association)5 Definitions (org.jbpm.bpmn2.core.Definitions)4 Error (org.jbpm.bpmn2.core.Error)4 RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)4 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 DataStore (org.jbpm.bpmn2.core.DataStore)3 ItemDefinition (org.jbpm.bpmn2.core.ItemDefinition)3 SequenceFlow (org.jbpm.bpmn2.core.SequenceFlow)3 ProcessBuildData (org.jbpm.compiler.xml.ProcessBuildData)3 ActionNode (org.jbpm.workflow.core.node.ActionNode)3 EndNode (org.jbpm.workflow.core.node.EndNode)3 EventNode (org.jbpm.workflow.core.node.EventNode)3 ForEachNode (org.jbpm.workflow.core.node.ForEachNode)3 StartNode (org.jbpm.workflow.core.node.StartNode)3 HashSet (java.util.HashSet)2 IntermediateLink (org.jbpm.bpmn2.core.IntermediateLink)2 Node (org.jbpm.workflow.core.Node)2 CompositeContextNode (org.jbpm.workflow.core.node.CompositeContextNode)2