ProcessInstance processInstance = contextInstance.getProcessInstance();
if (request.getAttribute("CompletedActivity") != null){
// Submit buttin named CompleteActivity is pressed
SpagoBITracer.info("Workflow", "CompleteOrRejectActivityModule", "service", "Completing Activity ["+ activityKeyId + "]");
taskInstance.end();
} else {
// Submit buttin named RejectActivity is pressed
SpagoBITracer.info("Workflow", "CompleteOrRejectActivityModule", "service", "Completing Activity ["+ activityKeyId + "]");
taskInstance.cancel();
}