AnsweredAssumed Answered

Add Listner on sequence flow transition progamatically

Question asked by gsrinivas10 on Oct 9, 2015
Latest reply on Oct 9, 2015 by martin.grofcik
      Can any one tell me how to add a listener on sequence flow transition programatically. Tried with the following code.

            List<ActivitiListener> lActivityListnerList = new LinkedList<ActivitiListener>();
            ActivitiListener lActivitiListner = new ActivitiListener();
            lActivitiListner.setImplementation( CustomExecutionListner.class.getName() );
            lActivitiListner.setImplementationType( ImplementationType.IMPLEMENTATION_TYPE_CLASS );
            lActivitiListner.setEvent( ExecutionListener.EVENTNAME_TAKE ); // perhaps not required as per activiti docs for sequence flow
            lActivityListnerList.add( lActivitiListner );
            SequenceFlow.setExecutionListeners( lActivityListnerList );

And wrote a class CustomExecutionListner extending ExecutionListner. But CustomExecutionListner class is not getting called. Any one tell me how to do this?