Package org.jbpm.workflow.instance.impl

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


                        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, association.getSources().get(0));
                if (variableScopeInstance != null) {
                    parameterValue = variableScopeInstance.getVariable(association.getSources().get(0));
                } else {
                    try {
                        parameterValue = MVEL.eval(association.getSources().get(0), new NodeInstanceResolverFactory(this));
                    } catch (Throwable t) {
                        System.err.println("Could not find variable scope for variable " + association.getSources().get(0));
                        System.err.println("when trying to execute Work Item " + work.getName());
                        System.err.println("Continuing without setting parameter.");
                    }
                }
                if (parameterValue != null) {
                    ((WorkItem) workItem).setParameter(association.getTarget(), parameterValue);
                }
            } else {
                for(Iterator<Assignment> it = association.getAssignments().iterator(); it.hasNext(); ) {
                    handleAssignment(it.next());
                }
            }
        }
       
        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.getSources().get(0));
            if (variableScopeInstance != null) {
                parameterValue = variableScopeInstance.getVariable(mapping.getSources().get(0));
            } else {
              try {
                parameterValue = MVEL.eval(mapping.getSources().get(0), new NodeInstanceResolverFactory(this));
              } catch (Throwable t) {
                System.err.println("Could not find variable scope for variable " + mapping.getSources().get(0));
                    System.err.println("when trying to execute SubProcess node " + getSubProcessNode().getName());
                    System.err.println("Continuing without setting parameter.");
              }
            }
            if (parameterValue != null) {
              parameters.put(mapping.getTarget(),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

                        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

TOP

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