use of org.activiti.engine.impl.scripting.ScriptingEngines in project Activiti by Activiti.
the class ScriptExecutionListener method notify.
@Override
public void notify(DelegateExecution execution) throws Exception {
validateParameters();
ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();
Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getValue(execution).toString(), execution);
if (resultVariable != null) {
execution.setVariable(resultVariable.getExpressionText(), result);
}
}
use of org.activiti.engine.impl.scripting.ScriptingEngines in project Activiti by Activiti.
the class ScriptTaskListener method notify.
public void notify(DelegateTask delegateTask) {
validateParameters();
ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();
Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), delegateTask, autoStoreVariables);
if (resultVariable != null) {
delegateTask.setVariable(resultVariable.getExpressionText(), result);
}
}
use of org.activiti.engine.impl.scripting.ScriptingEngines in project Activiti by Activiti.
the class ScriptEventHandler method handle.
@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());
throw e;
}
}
use of org.activiti.engine.impl.scripting.ScriptingEngines in project Activiti by Activiti.
the class ProcessEngineConfigurationImpl method initScriptingEngines.
protected void initScriptingEngines() {
if (resolverFactories == null) {
resolverFactories = new ArrayList<ResolverFactory>();
resolverFactories.add(new VariableScopeResolverFactory());
resolverFactories.add(new BeansResolverFactory());
}
if (scriptingEngines == null) {
scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(resolverFactories));
}
}
use of org.activiti.engine.impl.scripting.ScriptingEngines in project Activiti by Activiti.
the class JuelFormEngine method renderStartForm.
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);
}
Aggregations