use of org.camunda.bpm.engine.impl.delegate.ScriptInvocation in project camunda-bpm-platform by camunda.
the class ScriptExecutionListener method notify.
public void notify(DelegateExecution execution) throws Exception {
ScriptInvocation invocation = new ScriptInvocation(script, execution);
Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(invocation);
}
use of org.camunda.bpm.engine.impl.delegate.ScriptInvocation in project camunda-bpm-platform by camunda.
the class ScriptCaseExecutionListener method notify.
public void notify(DelegateCaseExecution caseExecution) throws Exception {
ScriptInvocation invocation = new ScriptInvocation(script, caseExecution);
Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(invocation);
}
use of org.camunda.bpm.engine.impl.delegate.ScriptInvocation in project camunda-bpm-platform by camunda.
the class ScriptCondition method evaluate.
@Override
public boolean evaluate(VariableScope scope, DelegateExecution execution) {
ScriptInvocation invocation = new ScriptInvocation(script, scope, execution);
try {
Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(invocation);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new ProcessEngineException(e);
}
Object result = invocation.getInvocationResult();
ensureNotNull("condition script returns null", "result", result);
ensureInstanceOf("condition script returns non-Boolean", "result", result, Boolean.class);
return (Boolean) result;
}
use of org.camunda.bpm.engine.impl.delegate.ScriptInvocation in project camunda-bpm-platform by camunda.
the class JuelFormEngine method executeScript.
protected Object executeScript(String scriptSrc, VariableScope scope) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
ScriptFactory scriptFactory = processEngineConfiguration.getScriptFactory();
ExecutableScript script = scriptFactory.createScriptFromSource(ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, scriptSrc);
ScriptInvocation invocation = new ScriptInvocation(script, scope);
try {
processEngineConfiguration.getDelegateInterceptor().handleInvocation(invocation);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new ProcessEngineException(e);
}
return invocation.getInvocationResult();
}
use of org.camunda.bpm.engine.impl.delegate.ScriptInvocation in project camunda-bpm-platform by camunda.
the class ScriptCaseVariableListener method notify.
public void notify(DelegateCaseVariableInstance variableInstance) throws Exception {
DelegateCaseVariableInstanceImpl variableInstanceImpl = (DelegateCaseVariableInstanceImpl) variableInstance;
ScriptInvocation invocation = new ScriptInvocation(script, variableInstanceImpl.getScopeExecution());
Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(invocation);
}
Aggregations