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

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


            final ContextResolver contextResolver) {
      Map map = createVariableContext(className, text, context, globals);
      List<String> variables = new ArrayList<String>();
      final List variableTypes = new ArrayList(globals.length);
        for (String variableName: unboundIdentifiers) {
          VariableScope variableScope = (VariableScope) contextResolver.resolveContext(VariableScope.VARIABLE_SCOPE, variableName);
          if (variableScope != null) {
            variables.add(variableName);
            variableTypes.add(variableScope.findVariable(variableName).getType().getStringType());
          }
        }

        map.put("variables",
                variables);
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

    private void visitHeader(WorkflowProcess process, StringBuffer 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

      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

    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

            Map<String, Class<?>> variableClasses = new HashMap<String, Class<?>>();
            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 {
                  variableClasses.put(variableName,
                    context.getDialect().getTypeResolver().resolveType(
                    variableScope.findVariable(variableName).getType().getStringType()));
                }
              }
            }
           
            MVELCompilationUnit unit = dialect.getMVELCompilationUnit( text,
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

    protected void visitHeader(WorkflowProcess process, StringBuffer 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

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.