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));
}
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;
}
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));
}
Aggregations