cancel
Showing results for 
Search instead for 
Did you mean: 

Logic seperation

mikepoole
Champ in-the-making
Champ in-the-making
I am currently evaluating Activiti (and BPMN in general) for our organisation and was wondering if I could ask 2 general questions with a view to just getting a pointer about WHERE it is best to put the logic (bean, Java task, BPMN etc)?

Users have asked the following questions about any possible technical solution…

1 - Within Activiti, where would you control the checks to see if a task can be completed? (ie: the task cannot be completed unless there is a value in an external field/user is not in a certain security group)

2 - Can you set a task to not be allowed to be completed manually? (ie: the user cannot press "Complete Task" in Explorer as the task can only be completed by an external process(i know, we will not be using Explorer upon deployment, but as an example))

Many thanks for your time as always

Mike
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
1. Those checks aren't informed on engine level. Currently, a user only sees tasks (in explorer) that are either directly assigned to him/her or is member of candidate-group. If you want additional checks or mechanisms, you should add this in the layer on top of activiti. In case of Activiti Explorer, you should edit the source, e.g.:


   TaskDetailPanel line 359:

   completeButton.setEnabled((isCurrentUserAssignee() || isCurrentUserOwner()) && myCustomCheckMethod());

In case of non-explorer usage, this can be added in the API/servcie that consumes activiti-API.

2. If you have "tasks" that aren't supposed to be completed by a human, the user-task isn't the right BPMN activity to use. Instead, use a "receive" task instead and the variables that you may want to pass to the process (like you do with the completeTask(task, vars)) can be done using runtimeService's setVariables(), before you notify the "receiveTask" to continue by signaling the workflow (also runtimeService).

mikepoole
Champ in-the-making
Champ in-the-making
Thanks Frederik. Really useful information. Makes a lot of sense

I really appreciate your time. Thanks again

Mike