Examples of ScriptManager


Examples of org.jbpm.pvm.internal.script.ScriptManager

    timerSession.schedule(this);
  }

  public void setDueDateDescription(String dueDateDescription) {

    ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
    dueDateDescription = (String) scriptManager.evaluateExpression(dueDateDescription, null);
   
    Duration duration = new Duration(dueDateDescription);
    Date now = Clock.getCurrentTime();
   
    if ( duration.isBusinessTime()
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

  public boolean evaluate(OpenExecution execution) {
    return (Boolean) evaluateExpression(execution);
  }

  public Object evaluateExpression(OpenExecution execution) {
    ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
    return scriptManager.evaluateExpression(expr, lang);
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

* @author Tom Baeyens
*/
public abstract class EnvironmentDefaults {

  public static ScriptManager getScriptManager() {
    ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class, false);
    if (scriptManager!=null) {
      return scriptManager;
    }
    return ScriptManager.getDefaultScriptManager();
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

      }
    }
  }

  protected String resolveAssignmentExpression(String expression, String expressionLanguage) {
    ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
    Object result = scriptManager.evaluateExpression(expression, expressionLanguage);
    if ( (result ==null)
         || (result instanceof String)
       ) {
      return (String) result;
    }
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

 
  public void execute(ExecutionImpl execution) {
    Activity activity = execution.getActivity();
    String transitionName = null;

    ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
    Object result = scriptManager.evaluateExpression(expr, lang);
    if ( (result!=null)
         && (! (result instanceof String))
       ) {
      throw new JbpmException("expression '"+expr+"' in decision '"+activity.getName()+"' returned "+result.getClass().getName()+" instead of a transitionName (String): "+result);
    }
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

  protected String script;
  protected String language;
  protected String variableName;

  public void perform(OpenExecution execution) {
    ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
    Object returnValue = scriptManager.evaluateScript(script, language);
   
    if (variableName!=null) {
      execution.setVariable(variableName, returnValue);
    }
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

    Object value = null;
   
    if (variableName!=null) {
      value = subProcessInstance.getVariable(subVariableName);
    } else {
      ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
      value = scriptManager.evaluateExpression(expression, language);
    }

    superExecution.setVariable(variableName, value);
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

  public void produce(ExecutionImpl superExecution, ExecutionImpl subProcessInstance) {
    Object value = null;
    if (variableName!=null) {
      value = superExecution.getVariable(variableName);
    } else {
      ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
      value = scriptManager.evaluateExpression(expression, language);
    }
   
    subProcessInstance.setVariable(subVariableName, value);
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

    String language = null;

    String script = XmlUtil.attribute(element, "expr");
    Element textElement = XmlUtil.element(element, "text");
    if(script!=null) {
      ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
      language = scriptManager.getDefaultExpressionLanguage();
      if (textElement!=null) {
        parse.addProblem("in <script ...> attribute expr can't be combined with a nexted text element", element);
      }
    } else {
      language = XmlUtil.attribute(element, "lang");
View Full Code Here

Examples of org.jbpm.pvm.internal.script.ScriptManager

     
      Activity activity = execution.getActivity();
      String subProcessActivityName = subProcessInstance.getActivityName();
     
      if (outcomeExpression!=null) {
        ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
        Object value = scriptManager.evaluateExpression(outcomeExpression, null);
        // if the value is a String and matches the name of an outgoing transition
        if ( (value instanceof String)
             && (activity.hasOutgoingTransition(((String) value)))
           ) {
          // then take that one
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.