Search in sources :

Example 1 with CompleteTask

use of org.activiti.cdi.annotation.CompleteTask in project Activiti by Activiti.

the class CompleteTaskInterceptor method invoke.

@AroundInvoke
public Object invoke(InvocationContext ctx) throws Exception {
    try {
        Object result = ctx.proceed();
        CompleteTask completeTaskAnnotation = ctx.getMethod().getAnnotation(CompleteTask.class);
        boolean endConversation = completeTaskAnnotation.endConversation();
        businessProcess.completeTask(endConversation);
        return result;
    } catch (InvocationTargetException e) {
        throw new ActivitiCdiException("Error while completing task: " + e.getCause().getMessage(), e.getCause());
    }
}
Also used : CompleteTask(org.activiti.cdi.annotation.CompleteTask) ActivitiCdiException(org.activiti.cdi.ActivitiCdiException) InvocationTargetException(java.lang.reflect.InvocationTargetException) AroundInvoke(javax.interceptor.AroundInvoke)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 AroundInvoke (javax.interceptor.AroundInvoke)1 ActivitiCdiException (org.activiti.cdi.ActivitiCdiException)1 CompleteTask (org.activiti.cdi.annotation.CompleteTask)1