Package org.drools.process.core.context.variable

Examples of org.drools.process.core.context.variable.VariableScope


public class AdHocSubProcessHandler extends CompositeContextNodeHandler {
   
    protected Node createNode(Attributes attrs) {
        DynamicNode result = new DynamicNode();
        VariableScope variableScope = new VariableScope();
        result.addContext(variableScope);
        result.setDefaultContext(variableScope);
        return result;
    }
View Full Code Here


        process.addNode(forEachNode);
        new ConnectionImpl(timerNode, Node.CONNECTION_DEFAULT_TYPE, forEachNode, Node.CONNECTION_DEFAULT_TYPE);
       
        CompositeContextNode compositeNode = new CompositeContextNode();
        compositeNode.setName("Composite");
        VariableScope variableScope = new VariableScope();
        compositeNode.addContext(variableScope);
        compositeNode.setDefaultContext(variableScope);
        variableScope.setVariables(variables);
        ExceptionScope exceptionScope = new ExceptionScope();
        compositeNode.addContext(exceptionScope);
        compositeNode.setDefaultContext(exceptionScope);
        exceptionHandler = new ActionExceptionHandler();
        exceptionHandler.setFaultVariable("faultVariable");
View Full Code Here

            "             xs:schemaLocation=\"http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd\"" + EOL +
            "             xmlns:di=\"http://bpmndi.org\"" + EOL +
            "             xmlns:tns=\"http://www.jboss.org/drools\">" + EOL + EOL);

      // item definitions
      VariableScope variableScope = (VariableScope)
        ((org.drools.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
      visitVariableScope(variableScope, "_", xmlDump);
      visitSubVariableScopes(process.getNodes(), xmlDump);
       
      xmlDump.append(
View Full Code Here

    }
   
    private void visitSubVariableScopes(Node[] nodes, StringBuilder xmlDump) {
        for (Node node: nodes) {
            if (node instanceof ContextContainer) {
                VariableScope variableScope = (VariableScope)
                    ((ContextContainer) node).getDefaultContext(VariableScope.VARIABLE_SCOPE);
                if (variableScope != null) {
                    visitVariableScope(variableScope, XmlBPMNProcessDumper.getUniqueNodeId(node) + "-", xmlDump);
                }
            }
View Full Code Here

    protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, boolean includeMeta) {
      // TODO: imports, function imports
      // TODO: globals
        // TODO: swimlanes
      // TODO: exception handlers
        VariableScope variableScope = (VariableScope)
          ((org.drools.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
        if (variableScope != null) {
            visitVariables(variableScope.getVariables(), xmlDump);
        }
    }
View Full Code Here

    final String itemSubjectRef = attrs.getValue("itemSubjectRef");

    Object parent = parser.getParent();
    if (parent instanceof ContextContainer) {
        ContextContainer contextContainer = (ContextContainer) parent;
        VariableScope variableScope = (VariableScope)
                contextContainer.getDefaultContext(VariableScope.VARIABLE_SCOPE);
      List variables = variableScope.getVariables();
      Variable variable = new Variable();
      variable.setMetaData("DataObject", "true");
      variable.setName(id);
      // retrieve type from item definition
      DataType dataType = new ObjectDataType();
View Full Code Here

public class SubProcessHandler extends AbstractNodeHandler {
   
    protected Node createNode(Attributes attrs) {
      CompositeContextNode result = new CompositeContextNode();
        VariableScope variableScope = new VariableScope();
        result.addContext(variableScope);
        result.setDefaultContext(variableScope);
        return result;
    }
View Full Code Here

    public CompositeNodeFactory variable(String name, DataType type, Object value) {
      Variable variable = new Variable();
      variable.setName(name);
      variable.setType(type);
      variable.setValue(value);
      VariableScope variableScope = (VariableScope)
      getCompositeNode().getDefaultContext(VariableScope.VARIABLE_SCOPE);
    if (variableScope == null) {
      variableScope = new VariableScope();
      getCompositeNode().addContext(variableScope);
      getCompositeNode().setDefaultContext(variableScope);
    }
    variableScope.getVariables().add(variable);
        return this;
    }
View Full Code Here

    private static final long serialVersionUID = 510l;
   
    public RuleFlowProcess() {
        setType(RULEFLOW_TYPE);
        // TODO create contexts on request ?
        VariableScope variableScope = new VariableScope();
        addContext(variableScope);
        setDefaultContext(variableScope);
        SwimlaneContext swimLaneContext = new SwimlaneContext();
        addContext(swimLaneContext);
        setDefaultContext(swimLaneContext);
View Full Code Here

        // Composite node
        CompositeContextNode compositeNode = new CompositeContextNode();
        compositeNode.setName("ForEachComposite");
        compositeNode.setMetaData("hidden", true);
        super.addNode(compositeNode);
        VariableScope variableScope = new VariableScope();
        compositeNode.addContext(variableScope);
        compositeNode.setDefaultContext(variableScope);
        // Join
        ForEachJoinNode join = new ForEachJoinNode();
        join.setName("ForEachJoin");
View Full Code Here

TOP

Related Classes of org.drools.process.core.context.variable.VariableScope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.