Search in sources :

Example 1 with CustomPropertiesResolver

use of org.activiti.engine.delegate.CustomPropertiesResolver in project Activiti by Activiti.

the class ListenerNotificationHelper method planTransactionDependentTaskListener.

protected void planTransactionDependentTaskListener(DelegateExecution execution, TransactionDependentTaskListener taskListener, ActivitiListener activitiListener) {
    Map<String, Object> executionVariablesToUse = execution.getVariables();
    CustomPropertiesResolver customPropertiesResolver = createCustomPropertiesResolver(activitiListener);
    Map<String, Object> customPropertiesMapToUse = invokeCustomPropertiesResolver(execution, customPropertiesResolver);
    TransactionDependentTaskListenerExecutionScope scope = new TransactionDependentTaskListenerExecutionScope(execution.getProcessInstanceId(), execution.getId(), (Task) execution.getCurrentFlowElement(), executionVariablesToUse, customPropertiesMapToUse);
    addTransactionListener(activitiListener, new ExecuteTaskListenerTransactionListener(taskListener, scope));
}
Also used : CustomPropertiesResolver(org.activiti.engine.delegate.CustomPropertiesResolver)

Example 2 with CustomPropertiesResolver

use of org.activiti.engine.delegate.CustomPropertiesResolver in project Activiti by Activiti.

the class ListenerNotificationHelper method createCustomPropertiesResolver.

protected CustomPropertiesResolver createCustomPropertiesResolver(ActivitiListener activitiListener) {
    CustomPropertiesResolver customPropertiesResolver = null;
    ListenerFactory listenerFactory = Context.getProcessEngineConfiguration().getListenerFactory();
    if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equalsIgnoreCase(activitiListener.getCustomPropertiesResolverImplementationType())) {
        customPropertiesResolver = listenerFactory.createClassDelegateCustomPropertiesResolver(activitiListener);
    } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equalsIgnoreCase(activitiListener.getCustomPropertiesResolverImplementationType())) {
        customPropertiesResolver = listenerFactory.createExpressionCustomPropertiesResolver(activitiListener);
    } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equalsIgnoreCase(activitiListener.getCustomPropertiesResolverImplementationType())) {
        customPropertiesResolver = listenerFactory.createDelegateExpressionCustomPropertiesResolver(activitiListener);
    }
    return customPropertiesResolver;
}
Also used : ListenerFactory(org.activiti.engine.impl.bpmn.parser.factory.ListenerFactory) CustomPropertiesResolver(org.activiti.engine.delegate.CustomPropertiesResolver)

Example 3 with CustomPropertiesResolver

use of org.activiti.engine.delegate.CustomPropertiesResolver in project Activiti by Activiti.

the class ListenerNotificationHelper method planTransactionDependentExecutionListener.

protected void planTransactionDependentExecutionListener(ListenerFactory listenerFactory, DelegateExecution execution, TransactionDependentExecutionListener executionListener, ActivitiListener activitiListener) {
    Map<String, Object> executionVariablesToUse = execution.getVariables();
    CustomPropertiesResolver customPropertiesResolver = createCustomPropertiesResolver(activitiListener);
    Map<String, Object> customPropertiesMapToUse = invokeCustomPropertiesResolver(execution, customPropertiesResolver);
    TransactionDependentExecutionListenerExecutionScope scope = new TransactionDependentExecutionListenerExecutionScope(execution.getProcessInstanceId(), execution.getId(), execution.getCurrentFlowElement(), executionVariablesToUse, customPropertiesMapToUse);
    addTransactionListener(activitiListener, new ExecuteExecutionListenerTransactionListener(executionListener, scope));
}
Also used : CustomPropertiesResolver(org.activiti.engine.delegate.CustomPropertiesResolver)

Aggregations

CustomPropertiesResolver (org.activiti.engine.delegate.CustomPropertiesResolver)3 ListenerFactory (org.activiti.engine.impl.bpmn.parser.factory.ListenerFactory)1