Package org.activiti.engine.impl.scripting

Examples of org.activiti.engine.impl.scripting.ScriptingEngines


    this.language = language;
    this.resultVariable = resultVariable;
  }
 
  public void execute(ActivityExecution execution) throws Exception {
    ScriptingEngines scriptingEngines = Context
      .getProcessEngineConfiguration()
      .getScriptingEngines();

    boolean noErrors = true;
    try {
      Object result = scriptingEngines.evaluate(script, language, execution);
     
      if (resultVariable != null) {
        execution.setVariable(resultVariable, result);
      }
View Full Code Here


  }

  @Override
  public void handle(SimulationEvent event) {
    ScriptingEngines scriptingEngines = Context
      .getProcessEngineConfiguration()
      .getScriptingEngines();

    VariableScope execution = SimulationRunContext.getExecution();
    try {
      scriptingEngines.evaluate((String) event.getProperty(this.scriptPropertyName), language, execution, false);

    } catch (ActivitiException e) {
      log.warn("Exception while executing simulation event " + event + " scriptPropertyName :" +
        this.scriptPropertyName + "\n script: "+ event.getProperty(this.scriptPropertyName) +
        "\n exception is:" + e.getMessage());
View Full Code Here

    String payloadExpressionValue = this.getStringFromField(this.payloadExpression, execution);
    String resultVariableValue = this.getStringFromField(this.resultVariable, execution);
    String usernameValue = this.getStringFromField(this.username, execution);
    String passwordValue = this.getStringFromField(this.password, execution);

    ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();
    Object payload = scriptingEngines.evaluate(payloadExpressionValue, languageValue, execution);
   
    if (endpointUrlValue.startsWith("vm:")) {
      LocalMuleClient client = this.getMuleContext().getClient();
      MuleMessage message = new DefaultMuleMessage(payload, this.getMuleContext());
      MuleMessage resultMessage = client.send(endpointUrlValue, message);
View Full Code Here

    this(script, language, resultVariable);
    this.storeScriptVariables = storeScriptVariables;
  }
 
  public void execute(ActivityExecution execution) throws Exception {
    ScriptingEngines scriptingEngines = Context
      .getProcessEngineConfiguration()
      .getScriptingEngines();

    boolean noErrors = true;
    try {
      Object result = scriptingEngines.evaluate(script, language, execution, storeScriptVariables);
     
      if (resultVariable != null) {
        execution.setVariable(resultVariable, result);
      }
View Full Code Here

    if (language == null) {
      throw new IllegalArgumentException("The field 'language' should be set on the TaskListener");
    }

    ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();

    Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), delegateTask, autoStoreVariables);

    if (resultVariable != null) {
      delegateTask.setVariable(resultVariable.getExpressionText(), result);
    }
  }
View Full Code Here

    if (language == null) {
      throw new IllegalArgumentException("The field 'language' should be set on the ExecutionListener");
    }

    ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();

    Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), execution);

    if (resultVariable != null) {
      execution.setVariable(resultVariable.getExpressionText(), result);
    }
  }
View Full Code Here

  public Object renderStartForm(StartFormData startForm) {
    if (startForm.getFormKey()==null) {
      return null;
    }
    String formTemplateString = getFormTemplateString(startForm, startForm.getFormKey());
    ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();
    return scriptingEngines.evaluate(formTemplateString, ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, null);
  }
View Full Code Here

  public Object renderTaskForm(TaskFormData taskForm) {
    if (taskForm.getFormKey()==null) {
      return null;
    }
    String formTemplateString = getFormTemplateString(taskForm, taskForm.getFormKey());
    ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();
    TaskEntity task = (TaskEntity) taskForm.getTask();
    return scriptingEngines.evaluate(formTemplateString, ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, task.getExecution());
  }
View Full Code Here

      resolverFactories = new ArrayList<ResolverFactory>();
      resolverFactories.add(new VariableScopeResolverFactory());
      resolverFactories.add(new BeansResolverFactory());
    }
    if (scriptingEngines==null) {
      scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(resolverFactories));
    }
  }
View Full Code Here

    if (language == null) {
      throw new IllegalArgumentException("The field 'language' should be set on the TaskListener");
    }

    ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();

    Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), delegateTask);

    if (resultVariable != null) {
      delegateTask.setVariable(resultVariable.getExpressionText(), result);
    }
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.scripting.ScriptingEngines

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.