As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<bean id="mailBean" class="com.utils.MailBean" > <property name="mailService"> <ref bean="mailService"/> </property> </bean>
<util:map id="activitiBeanRegistry" map-class="java.util.HashMap"> <entry key="services" value-ref="ServiceRegistry" /> <entry key="SetWorkflowUsers" value-ref="SetWorkflowUsers" /> // In my case SetWorkflowUsers extends ScriptExecutionListener. Also SetWorkflowUsers is my bean id. </util:map>
<bean id="SetWorkflowUsers" class="com.demo.workflow.SetWorkflowUsers"> <property name="serviceRegistry"> <ref bean="ServiceRegistry" /> </property> <property name="nodeService"> <ref bean="NodeService" /> </property> <property name="searchService"> <ref bean="SearchService"/> </property> </bean> and put below entry/method in SetWorkflowUsers.java /** * * get SetworkflowUsers 's object from Context * * */ protected SetWorkflowUsers getSetWorkflowUsers() { ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration(); if (config != null) { // Fetch the registry that is injected in the activiti spring-configuration SetWorkflowUsers setWorkflowUsers = (SetWorkflowUsers) config.getBeans().get("SetWorkflowUsers"); if (setWorkflowUsers == null) { throw new RuntimeException( "setWorkflowUsers not present in ProcessEngineConfiguration beans, expected setWorkflowUsers with key SetWorkflowUsers"); } return setWorkflowUsers; } throw new IllegalStateException("No ProcessEngineCOnfiguration found in active context"); }