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

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


        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


    processInstance.setWorkingMemory( (InternalWorkingMemory) workingMemory );
        processInstance.setProcess( process );
       
        // 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

        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


            List<String> variableNames = analysis.getNotBoundedIdentifiers();
            if (contextResolver != null) {
              for (String variableName: variableNames) {
                VariableScope variableScope = (VariableScope) contextResolver.resolveContext(VariableScope.VARIABLE_SCOPE, variableName);
                if (variableScope == null) {
                  context.getErrors().add(
                  new DescrBuildError(
                  context.getParentDescr(),
                              actionDescr,
                              null,
                              "Could not find variable '" + variableName + "' for action '" + actionDescr.getText() + "'" ) );               
                } else {
                  variables.put(variableName,
                    context.getDialect().getTypeResolver().resolveType(
                    variableScope.findVariable(variableName).getType().getStringType()));
                }
              }
            }

            MVELCompilationUnit unit = dialect.getMVELCompilationUnit( text,
View Full Code Here

                                                                    null );        

            List<String> variableNames = analysis.getNotBoundedIdentifiers();
            if (contextResolver != null) {
              for (String variableName: variableNames) {
                VariableScope variableScope = (VariableScope) contextResolver.resolveContext(VariableScope.VARIABLE_SCOPE, variableName);
                if (variableScope == null) {
                  context.getErrors().add(
                  new DescrBuildError(
                  context.getParentDescr(),
                              descr,
                              null,
                              "Could not find variable '" + variableName + "' for constraint '" + descr.getText() + "'" ) );               
                } else {
                  variables.put(variableName,
                    context.getDialect().getTypeResolver().resolveType(
                    variableScope.findVariable(variableName).getType().getStringType()));
                }
              }
            }
           
            MVELCompilationUnit unit = dialect.getMVELCompilationUnit( text,
View Full Code Here

    protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, boolean includeMeta) {
        xmlDump.append("  <header>" + EOL);
        visitImports(((org.drools.process.core.Process) process).getImports(), xmlDump);
        visitGlobals(((org.drools.process.core.Process) process).getGlobals(), xmlDump);
        visitFunctionImports(((org.drools.process.core.Process) process).getFunctionImports(), xmlDump);
        VariableScope variableScope = (VariableScope)
          ((org.drools.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
        if (variableScope != null) {
            visitVariables(variableScope.getVariables(), xmlDump);
        }
        SwimlaneContext swimlaneContext = (SwimlaneContext)
          ((org.drools.process.core.Process) process).getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE);
        if (swimlaneContext != null) {
            visitSwimlanes(swimlaneContext.getSwimlanes(), xmlDump);
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

      super.writeNode(getNodeName(), node, xmlDump, includeMeta);
        CompositeNode compositeNode = (CompositeNode) node;
        writeAttributes(compositeNode, xmlDump, includeMeta);
        xmlDump.append(">" + EOL);
        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

                                    attrs );
        ContextContainer contextContainer = (ContextContainer) parser.getParent();
        final String name = attrs.getValue("name");
        emptyAttributeCheck(localName, "name", name, parser);
       
        VariableScope variableScope = (VariableScope)
            contextContainer.getDefaultContext(VariableScope.VARIABLE_SCOPE);
        Variable variable = new Variable();
        if (variableScope != null) {
            variable.setName(name);
            List<Variable> variables = variableScope.getVariables();
            if (variables == null) {
                variables = new ArrayList<Variable>();
                variableScope.setVariables(variables);
            }
            variables.add(variable);
        } else {
            throw new SAXParseException(
                "Could not find default variable scope.", parser.getLocator());
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.