Package org.jbpm.pvm.internal.script

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


 
  protected String expression;
  protected String language;
 
  public Object construct(WireContext wireContext) {
    ScriptManager scriptManager = ScriptManager.getScriptManager();
    Object result = scriptManager.evaluateExpression(expression, language);
    return result;
  }
View Full Code Here


 
  protected String expression;
  protected String language;
 
  public boolean evaluate(OpenExecution execution) {
    ScriptManager scriptManager = ScriptManager.getScriptManager();
    Object result = scriptManager.evaluateExpression(expression, language);
    if (result instanceof Boolean) {
      return ((Boolean) result).booleanValue();
    }
    throw new JbpmException("expression condition '"+expression+"' did not return a boolean: "+result);
  }
View Full Code Here

    TimerSession timerSession = EnvironmentImpl.getFromCurrent(TimerSession.class);
    timerSession.schedule(this);
  }

  public void setDueDateDescription(String dueDateDescription) {
    ScriptManager scriptManager = ScriptManager.getScriptManager();
    dueDateDescription = (String) scriptManager.evaluateExpression(dueDateDescription, null);
    Date now = Clock.getCurrentTime();
    BusinessCalendar businessCalendar = EnvironmentImpl.getFromCurrent(BusinessCalendar.class);
    duedate = businessCalendar.add(now, dueDateDescription);
  }
View Full Code Here

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

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

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

    String language = null;

    String script = XmlUtil.attribute(element, "expr");
    Element textElement = XmlUtil.element(element, "text");
    if(script!=null) {
      ScriptManager scriptManager = EnvironmentImpl.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

     
      Activity activity = execution.getActivity();
      String subProcessActivityName = subProcessInstance.getActivityName();
     
      if (outcomeExpression!=null) {
        ScriptManager scriptManager = EnvironmentImpl.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

  void perform(OpenExecution execution) throws Exception {
    Object value = null;
   
    if (expression!=null) {
      ScriptManager scriptManager = ScriptManager.getScriptManager();
      value = scriptManager.evaluateExpression(expression, language);
     
    } else if (valueDescriptor!=null) {
      value = WireContext.create(valueDescriptor);
    }
   
View Full Code Here

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

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

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

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

TOP

Related Classes of org.jbpm.pvm.internal.script.ScriptManager

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.