Examples of VariableScope


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

        for (org.drools.definition.process.Node subNode: ((CompositeContextNode) node).getNodes()) {
          forEachNode.addNode(subNode);
        }
        forEachNode.setMetaData("UniqueId", ((CompositeContextNode) node).getMetaData("UniqueId"));
        forEachNode.setMetaData(ProcessHandler.CONNECTIONS, ((CompositeContextNode) node).getMetaData(ProcessHandler.CONNECTIONS));
        VariableScope v = (VariableScope) ((CompositeContextNode) node).getDefaultContext(VariableScope.VARIABLE_SCOPE);
        ((VariableScope) ((CompositeContextNode) forEachNode.internalGetNode(2)).getDefaultContext(VariableScope.VARIABLE_SCOPE)).setVariables(v.getVariables());
        node = forEachNode;
        handleForEachNode(node, element, uri, localName, parser);
        found = true;
        break;
      }
View Full Code Here

Examples of org.jbpm.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

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

              "             xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\"" + EOL +
            "             xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\"" + EOL : "") +
            "             xmlns:tns=\"http://www.jboss.org/drools\">" + EOL + EOL);

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

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

    }
   
    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

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

        }
        xmlDump.append("    </extensionElements>" + EOL);
      }
      // TODO: function imports
      // TODO: exception handlers
        VariableScope variableScope = (VariableScope)
          ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
        if (variableScope != null) {
            visitVariables(variableScope.getVariables(), xmlDump);
        }
        visitLanes(process, xmlDump);
    }
View Full Code Here

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

    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.setName(id);
      // retrieve type from item definition
      DataType dataType = new ObjectDataType();
      Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>)
View Full Code Here

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

    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

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

        // 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

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

        return super.getLinkedOutgoingNode(inType);
    }
    
    public void setVariable(String variableName, DataType type) {
        this.variableName = variableName;
        VariableScope variableScope = (VariableScope) getCompositeNode().getDefaultContext(VariableScope.VARIABLE_SCOPE);
        List<Variable> variables = variableScope.getVariables();
        if (variables == null) {
          variables = new ArrayList<Variable>();
          variableScope.setVariables(variables);
        }
        Variable variable = new Variable();
        variable.setName(variableName);
        variable.setType(type);
        variables.add(variable);
View Full Code Here

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

        ((InternalProcessRuntime) kruntime.getProcessRuntime()).getProcessInstanceManager()
        .addProcessInstance( processInstance );

        // set variable default values
        // TODO: should be part of processInstanceImpl?
        VariableScope variableScope = (VariableScope) ((ContextContainer) process).getDefaultContext( VariableScope.VARIABLE_SCOPE );
        VariableScopeInstance variableScopeInstance = (VariableScopeInstance) processInstance.getContextInstance( VariableScope.VARIABLE_SCOPE );
        // set input parameters
        if ( parameters != null ) {
            if ( variableScope != null ) {
                for ( Map.Entry<String, Object> entry : parameters.entrySet() ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.