cancel
Showing results for 
Search instead for 
Did you mean: 

Integration Activiti UserTask and JSF

ryu
Champ in-the-making
Champ in-the-making
Hi all,

Our current project uses JSF and EJB to build applications… I see that Activiti has a nice web application called Activiti Explorer, which uses Spring MVC. With it, views can be called via a userTask and form data are mapped automatically into process's variables. So my question is, if it is possible that we modify our JSF (or the engine) so that JSF has these functionalities with userTask.

I am not familiar with Spring MVC, it would be nice if you can give me:
(1) some hints, or
(2) a list of modifications you can think of, as a starting point for me to look into, or
(3) the fundamentals of Activiti Explorer in relation with Activiti Engine?

Thank you very much
14 REPLIES 14

jbarrez
Star Contributor
Star Contributor
The Explorer bascially calls the REST-API and then visualizes the result. That should be feasable with JSF.

Ronald has already implemented something with Activiti and JSF. i'm sure he will respond to this message Smiley Happy

ryu
Champ in-the-making
Champ in-the-making
oh thank you jbarrez, I haven't thought of this before 😃 happy to hear something more from Ronald

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Hahaha. I hate it when people know you too well.

Yes, I already impemented something like this and it will be published around the release of 5.4 but it will be visible in svn on an earlier date, maybe next week. Itexplicitly does *not* use the rest api but CDI. Using rest here would be a waste of… well, time for sure since jsf components know java and not rest so wrappers needed to be created with no functionality… Yuck.

What will be available initially is custom components for tasklists (user and group), a task overview (like the left thing in the explorer) and functionality to render a form based on just the form properties in the processdefinition. These will be based on primefaces and use metawidget for the form.

ryu
Champ in-the-making
Champ in-the-making
haha It's really fun there
well, this is what I guess to integrate Activiti UserTask and JSF (well let me guess, if it is wrong please correct me):

A. Requirements: MVC
The process can navigate the user from sites to sites via UserTask, of course performs EJB functions in the middle between userTask, select views and return data model back to the user.

B. TODO:
1. Requests from user are sent to a Controller (a managed bean)
2. Controller creates process instance and user's request information are input as process variables.
3. Process instance executes, until it access to a userTask, a notify is send back to the Controller
   OR the Controller waits in a while loop until a certain process variable saying that a userTask is entered (using getVariable….)
4. Controller returns an according form of the userTask to the user
5. Process instance continues to the next activity.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
yes, basically it is that simple

3. Process instance executes, until it access to a userTask, a notify is send back to the Controller
   OR the Controller waits in a while loop until a certain process variable saying that a userTask is entered (using getVariable….)

Or… When the user navigates back to his tasklist, it is retrieved again. No callbacks and i'd certainly not do loops

ryu
Champ in-the-making
Champ in-the-making
Thank you Ronald,

one last question. So when the user navigates back to his tasklist, he can see a task which requires his confirmation or form completion. So my question is: after he finished, the controller (managed bean) should trigger a function for the process instance to continue executing on the next task. Does the engine has such a function to pause and replay a process instance?

Thank you again.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
So my question is: after he finished, the controller (managed bean) should trigger a function for the process instance to continue executing on the next task.
Yes

Does the engine has such a function to pause and replay a process instance?

not needed. I think you should experiment a little more with the taskservice and runtimeservice (and/or buy the activiti in action book) and you will see.

ryu
Champ in-the-making
Champ in-the-making
Hi Ronald,

would you please have a big friendliness to show me where is the JSF app in SVN? May I take a look at it too? Because I couldn't find it

Thank you 😃

thetoolman
Champ in-the-making
Champ in-the-making
Yes please note the SVN location for this as soon as it is in there … Smiley Happy