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

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


    private static final long serialVersionUID = 400L;
   
    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

    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

        processInstance.setWorkingMemory( this );
        processInstance.setProcess( process );
        processInstanceManager.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

public class CompositeNodeHandler extends AbstractNodeHandler {

    protected Node createNode() {
        CompositeContextNode result = new CompositeContextNode();
        VariableScope variableScope = new VariableScope();
        result.addContext(variableScope);
        result.setDefaultContext(variableScope);
        return result;
    }
View Full Code Here

      for (String eventType: compositeNode.getActionTypes()) {
          writeActions(eventType, compositeNode.getActions(eventType), xmlDump);
        }
        writeTimers(compositeNode.getTimers(), xmlDump);
        if (compositeNode instanceof CompositeContextNode) {
          VariableScope variableScope = (VariableScope)
        ((CompositeContextNode) compositeNode).getDefaultContext(VariableScope.VARIABLE_SCOPE);
          if (variableScope != null) {
            List<Variable> variables = variableScope.getVariables();
            XmlWorkflowProcessDumper.visitVariables(variables, xmlDump);
          }
          ExceptionScope exceptionScope = (ExceptionScope)
        ((CompositeContextNode) compositeNode).getDefaultContext(ExceptionScope.EXCEPTION_SCOPE);
        if (exceptionScope != null) {
View Full Code Here

        processInstance.setWorkingMemory( this );
        processInstance.setProcess( process );
        processInstanceManager.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

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

    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

        nodeType = "transaction";
      }
    writeNode(nodeType, compositeNode, xmlDump, includeMeta);
    xmlDump.append(" >" + EOL);
        // variables
    VariableScope variableScope = (VariableScope)
            compositeNode.getDefaultContext(VariableScope.VARIABLE_SCOPE);
    if (variableScope != null && !variableScope.getVariables().isEmpty()) {
            xmlDump.append("    <!-- variables -->" + EOL);
            for (Variable variable: variableScope.getVariables()) {
                xmlDump.append("    <property id=\"" + XmlDumper.replaceIllegalChars(variable.getName()) + "\" ");
                if (variable.getType() != null) {
                    xmlDump.append("itemSubjectRef=\"" + XmlBPMNProcessDumper.getUniqueNodeId(compositeNode) + "-" + XmlDumper.replaceIllegalChars(variable.getName()) + "Item\"" );
                }
                // TODO: value
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.