Examples of ScriptManager


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

    if (target!=null) {
      invocationTarget = target;

    } else if (targetExpression!=null) {
      ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
      invocationTarget = scriptManager.evaluateExpression(targetExpression, targetLanguage);
   
    } else {
      throw new JbpmException("no target specified");
    }
View Full Code Here

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

  public Object getInitValue(ExecutionImpl execution) {
    if (initDescriptor!=null) {
      return WireContext.create(initDescriptor);
    }
    if (initExpression!=null) {
      ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
      return scriptManager.evaluateExpression(initExpression, initLanguage);
    }
    return null;
  }
View Full Code Here

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

      }
    }
  }

  private String evaluateExpression(String expression, Execution execution) {
    ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
    Object value = scriptManager.evaluateExpression(expression, template.getLanguage());
    if (!(value instanceof String)) {
      throw new JbpmException("expected expression '"
          + expression
          + "' to return string, but was: "
          + value);
View Full Code Here

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

      object = wireContext.create(factoryDescriptor, false);
      if (object==null) {
        throw new WireException("created factory object is null, can't invoke method '"+methodName+"' on it");
      }
    } else if (expr!=null) {
      ScriptManager scriptManager = ScriptManager.getScriptManager();
      object = scriptManager.evaluateExpression(expr, lang);
    }

    if (methodName!=null) {
      try {
        object = invokeMethod(methodName, argDescriptors, wireContext, object, clazz);
View Full Code Here

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

    // loop over all variable definitions
    if (hasVariableOutDefinitions()) {
      for (VariableOutDefinitionImpl variableOutDefinition: variableOutDefinitions) {
        String variableName = variableOutDefinition.getName();
        if (variableName!=null) {
          ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
         
          // TODO update evaluateExpression so that scopeInstance can be passed in directly
          String expression = variableOutDefinition.getExpression();
          String language = variableOutDefinition.getLanguage();

          Object value = scriptManager.evaluateExpression(expression, language);
          outerExecution.setVariable(variableName, value);
        }
      }
    }
  }
View Full Code Here

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

      }
    }
  }

  protected String resolveAssignmentExpression(String expression, String expressionLanguage) {
    ScriptManager scriptManager = EnvironmentImpl.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

 
  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

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

 
  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

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

    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

Examples of org.jsgene.script.ScriptManager

  public static void main(String[] args)
  {
    windowType = "native";
    Color.createDefaultColors();
   
    scriptManager = new ScriptManager();
    scriptManager.loadScript("main.js");
    scriptManager.executeScript("main.js");
  }
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.