-
1. Re: Tasks of completed instances are not removed
jimmy001 Jul 1, 2015 10:55 AM (in response to jimmy001)A short update:
I found a class "TaskCleanUpProcessEventListener" and tried to register it in the EnviromentProducer by calling InjectableRegisterableItemsFactory.addProcessListener .
But it is never called. Next I tried to register it in a subclass of "DeploymentServiceCDIImpl" by overriding "getRegisterableItemsFactory". Never called.
-
2. Re: Tasks of completed instances are not removed
swiderski.maciej Jul 3, 2015 5:02 AM (in response to jimmy001)that's the class responsible for removing it.
What is your environment you run jBPM? Is it workbench? Custom app? What version of jBPM do you use?
In general you have several options:
- use CDI to provide listeners to be registered
- use deployment descriptor to define listeners to be registered
- manually register listeners by extending some implementations
all depends on your use of jBPM
HTH
-
3. Re: Tasks of completed instances are not removed
jimmy001 Jul 6, 2015 5:41 AM (in response to swiderski.maciej)Hi,
I am using 6.3.snapshot and CDI Services embedded in my application. I would have exepected, that the following would work, since I can successfully register a task listener:
/** Initializes runtime enviroment and manager for injection */ @PostConstruct public void init() { LOG.debug("Init Enviroment"); factory.addTaskListener(MyTaskEventListener.class); factory.addProcessListener(TaskCleanUpProcessEventListener.class); TaskModelProvider.setTaskModelProviderService(new MyTaskModelProviderService()); ProcessInstanceFactoryRegistry.INSTANCE.register( RuleFlowProcess.class, new MyProcessInstanceFactory() ); }
But the processListener instance is never created.
I am deploying the process by using DeploymentServiceCDIImpl, if this info is of any relevance.
-
4. Re: Tasks of completed instances are not removed
swiderski.maciej Jul 13, 2015 1:25 AM (in response to jimmy001)this won't work as TaskCleanupProcessEventListener requires task service to be able to find tasks by process instance id. Since you're using CDI I would recommend to use producer for it similar to what workbench is using.
HTH