AnsweredAssumed Answered

Delete task listener and Complete task listener problem

Question asked by yahekia on Feb 7, 2014
Latest reply on Feb 11, 2014 by jbarrez
Hi there,


I am having a couple of problems with a delete listener, here is some background about this issue. I am using Activiti 5.13, and I have a complete task listener and a delete task listener, I also have a task service that ends all processes that share the same property value:


@Override
    public void execute(DelegateExecution execution) throws Exception {
        int myPropertie= (Integer) execution.getVariable("myPropertie");
        final RuntimeService runtimeService = execution.getEngineServices().getRuntimeService();
        List<Execution> executions = runtimeService.createExecutionQuery().variableValueEquals("myPropertie", myPropertie)
                .list();

        for (Execution ex : executions) {
            runtimeService.deleteProcessInstance(ex.getProcessInstanceId(), "my delete reason");
        }

    }


The first problem is that both listeners are being fired, I think this should not be happening but I do not know if it is coded that way for some reason.

The second problem is that I do not have any way to get the delete reason in the delegate task neither in the taskhistory instance, Is there  any place where I can get the value¿¿??

Thanks for your time.

Javi.

Outcomes