Package org.drools.workflow.instance.impl

Examples of org.drools.workflow.instance.impl.NodeInstanceResolverFactory


                resolveContextInstance(VariableScope.VARIABLE_SCOPE, collectionExpression);
            if (variableScopeInstance != null) {
              collection = variableScopeInstance.getVariable(collectionExpression);
            } else {
              try {
                collection = MVEL.eval(collectionExpression, new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                throw new IllegalArgumentException(
                        "Could not find collection " + collectionExpression);
              }
               
View Full Code Here


                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
              parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                  System.err.println("Could not find variable scope for variable " + mapping.getValue());
                  System.err.println("when trying to execute Work Item " + work.getName());
                  System.err.println("Continuing without setting parameter.");
              }
            }
            if (parameterValue != null) {
              ((WorkItem) workItem).setParameter(mapping.getKey(), parameterValue);
            }
        }
        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
          if (entry.getValue() instanceof String) {
            String s = (String) entry.getValue();
            Map<String, String> replacements = new HashMap<String, String>();
            Matcher matcher = PARAMETER_MATCHER.matcher(s);
                while (matcher.find()) {
                  String paramName = matcher.group(1);
                  if (replacements.get(paramName) == null) {
                  VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                      resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                    if (variableScopeInstance != null) {
                        Object variableValue = variableScopeInstance.getVariable(paramName);
                      String variableValueString = variableValue == null ? "" : variableValue.toString();
                      replacements.put(paramName, variableValueString);
                    } else {
                      try {
                        Object variableValue = MVEL.eval(paramName, new NodeInstanceResolverFactory(this));
                        String variableValueString = variableValue == null ? "" : variableValue.toString();
                        replacements.put(paramName, variableValueString);
                      } catch (Throwable t) {
                          System.err.println("Could not find variable scope for variable " + paramName);
                          System.err.println("when trying to replace variable in string for Work Item " + work.getName());
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
                parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                System.err.println("Could not find variable scope for variable " + mapping.getValue());
                    System.err.println("when trying to execute SubProcess node " + getSubProcessNode().getName());
                    System.err.println("Continuing without setting parameter.");
              }
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
                parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                System.err.println("Could not find variable scope for variable " + mapping.getValue());
                    System.err.println("when trying to execute SubProcess node " + getSubProcessNode().getName());
                    System.err.println("Continuing without setting parameter.");
              }
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
              parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                  System.err.println("Could not find variable scope for variable " + mapping.getValue());
                  System.err.println("when trying to execute Work Item " + work.getName());
                  System.err.println("Continuing without setting parameter.");
              }
            }
            if (parameterValue != null) {
              ((WorkItem) workItem).setParameter(mapping.getKey(), parameterValue);
            }
        }
        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
          if (entry.getValue() instanceof String) {
            String s = (String) entry.getValue();
            Map<String, String> replacements = new HashMap<String, String>();
            Matcher matcher = PARAMETER_MATCHER.matcher(s);
                while (matcher.find()) {
                  String paramName = matcher.group(1);
                  if (replacements.get(paramName) == null) {
                  VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                      resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                    if (variableScopeInstance != null) {
                        Object variableValue = variableScopeInstance.getVariable(paramName);
                      String variableValueString = variableValue == null ? "" : variableValue.toString();
                      replacements.put(paramName, variableValueString);
                    } else {
                      try {
                        Object variableValue = MVEL.eval(paramName, new NodeInstanceResolverFactory(this));
                        String variableValueString = variableValue == null ? "" : variableValue.toString();
                        replacements.put(paramName, variableValueString);
                      } catch (Throwable t) {
                          System.err.println("Could not find variable scope for variable " + paramName);
                          System.err.println("when trying to replace variable in string for Work Item " + work.getName());
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
              parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                  System.err.println("Could not find variable scope for variable " + mapping.getValue());
                  System.err.println("when trying to execute Work Item " + work.getName());
                  System.err.println("Continuing without setting parameter.");
              }
            }
            if (parameterValue != null) {
              ((WorkItem) workItem).setParameter(mapping.getKey(), parameterValue);
            }
        }
        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
          if (entry.getValue() instanceof String) {
            String s = (String) entry.getValue();
            Map<String, String> replacements = new HashMap<String, String>();
            Matcher matcher = PARAMETER_MATCHER.matcher(s);
                while (matcher.find()) {
                  String paramName = matcher.group(1);
                  if (replacements.get(paramName) == null) {
                  VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                      resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                    if (variableScopeInstance != null) {
                        Object variableValue = variableScopeInstance.getVariable(paramName);
                      String variableValueString = variableValue == null ? "" : variableValue.toString();
                      replacements.put(paramName, variableValueString);
                    } else {
                      try {
                        Object variableValue = MVEL.eval(paramName, new NodeInstanceResolverFactory(this));
                        String variableValueString = variableValue == null ? "" : variableValue.toString();
                        replacements.put(paramName, variableValueString);
                      } catch (Throwable t) {
                          System.err.println("Could not find variable scope for variable " + paramName);
                          System.err.println("when trying to replace variable in string for Work Item " + work.getName());
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, collectionExpression);
            if (variableScopeInstance != null) {
              collection = variableScopeInstance.getVariable(collectionExpression);
            } else {
              try {
                collection = MVEL.eval(collectionExpression, new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                throw new IllegalArgumentException(
                        "Could not find collection " + collectionExpression);
              }
               
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
              parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                  System.err.println("Could not find variable scope for variable " + mapping.getValue());
                  System.err.println("when trying to execute Work Item " + work.getName());
                  System.err.println("Continuing without setting parameter.");
              }
            }
            if (parameterValue != null) {
              ((WorkItem) workItem).setParameter(mapping.getKey(), parameterValue);
            }
        }
        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
          if (entry.getValue() instanceof String) {
            String s = (String) entry.getValue();
            Map<String, String> replacements = new HashMap<String, String>();
            Matcher matcher = PARAMETER_MATCHER.matcher(s);
                while (matcher.find()) {
                  String paramName = matcher.group(1);
                  if (replacements.get(paramName) == null) {
                  VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                      resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                    if (variableScopeInstance != null) {
                        Object variableValue = variableScopeInstance.getVariable(paramName);
                      String variableValueString = variableValue == null ? "" : variableValue.toString();
                      replacements.put(paramName, variableValueString);
                    } else {
                      try {
                        Object variableValue = MVEL.eval(paramName, new NodeInstanceResolverFactory(this));
                        String variableValueString = variableValue == null ? "" : variableValue.toString();
                        replacements.put(paramName, variableValueString);
                      } catch (Throwable t) {
                          System.err.println("Could not find variable scope for variable " + paramName);
                          System.err.println("when trying to replace variable in string for Work Item " + work.getName());
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
                parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                System.err.println("Could not find variable scope for variable " + mapping.getValue());
                    System.err.println("when trying to execute SubProcess node " + getSubProcessNode().getName());
                    System.err.println("Continuing without setting parameter.");
              }
            }
            if (parameterValue != null) {
              parameters.put(mapping.getKey(),parameterValue);
            }
        }
        String processId = getSubProcessNode().getProcessId();
        // resolve processId if necessary
        Map<String, String> replacements = new HashMap<String, String>();
    Matcher matcher = PARAMETER_MATCHER.matcher(processId);
        while (matcher.find()) {
          String paramName = matcher.group(1);
          if (replacements.get(paramName) == null) {
              VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                  resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                if (variableScopeInstance != null) {
                    Object variableValue = variableScopeInstance.getVariable(paramName);
                  String variableValueString = variableValue == null ? "" : variableValue.toString();
                  replacements.put(paramName, variableValueString);
                } else {
                  try {
                    Object variableValue = MVEL.eval(paramName, new NodeInstanceResolverFactory(this));
                    String variableValueString = variableValue == null ? "" : variableValue.toString();
                    replacements.put(paramName, variableValueString);
                  } catch (Throwable t) {
                      System.err.println("Could not find variable scope for variable " + paramName);
                      System.err.println("when trying to replace variable in processId for sub process " + getNodeName());
View Full Code Here

                resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
            if (variableScopeInstance != null) {
              parameterValue = variableScopeInstance.getVariable(mapping.getValue());
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getValue(), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                  System.err.println("Could not find variable scope for variable " + mapping.getValue());
                  System.err.println("when trying to execute Work Item " + work.getName());
                  System.err.println("Continuing without setting parameter.");
              }
            }
            if (parameterValue != null) {
              ((WorkItem) workItem).setParameter(mapping.getKey(), parameterValue);
            }
        }
        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
          if (entry.getValue() instanceof String) {
            String s = (String) entry.getValue();
            Map<String, String> replacements = new HashMap<String, String>();
            Matcher matcher = PARAMETER_MATCHER.matcher(s);
                while (matcher.find()) {
                  String paramName = matcher.group(1);
                  if (replacements.get(paramName) == null) {
                  VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                      resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                    if (variableScopeInstance != null) {
                        Object variableValue = variableScopeInstance.getVariable(paramName);
                      String variableValueString = variableValue == null ? "" : variableValue.toString();
                      replacements.put(paramName, variableValueString);
                    } else {
                      try {
                        Object variableValue = MVEL.eval(paramName, new NodeInstanceResolverFactory(this));
                        String variableValueString = variableValue == null ? "" : variableValue.toString();
                        replacements.put(paramName, variableValueString);
                      } catch (Throwable t) {
                          System.err.println("Could not find variable scope for variable " + paramName);
                          System.err.println("when trying to replace variable in string for Work Item " + work.getName());
View Full Code Here

TOP

Related Classes of org.drools.workflow.instance.impl.NodeInstanceResolverFactory

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.