Search in sources :

Example 1 with TestVariableScope

use of org.camunda.spin.plugin.script.TestVariableScope in project camunda-bpm-platform by camunda.

the class SpinFunctionMapperTest method executeExpression.

@SuppressWarnings("unchecked")
protected <T> T executeExpression(String expression) {
    final TestVariableScope varScope = new TestVariableScope();
    final Expression compiledExpression = processEngineConfiguration.getExpressionManager().createExpression(expression);
    return (T) processEngineConfiguration.getCommandExecutorTxRequired().execute(new Command<Object>() {

        public Object execute(CommandContext commandContext) {
            return compiledExpression.getValue(varScope);
        }
    });
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) Expression(org.camunda.bpm.engine.delegate.Expression) Command(org.camunda.bpm.engine.impl.interceptor.Command) TestVariableScope(org.camunda.spin.plugin.script.TestVariableScope)

Aggregations

Expression (org.camunda.bpm.engine.delegate.Expression)1 Command (org.camunda.bpm.engine.impl.interceptor.Command)1 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1 TestVariableScope (org.camunda.spin.plugin.script.TestVariableScope)1