AnsweredAssumed Answered

UserTask opens Dialog and Partial update

Question asked by urban1 on Aug 16, 2012
Hi everybody

I´m really new to Bpmn and Activiti. Therefore i hope my question is not so stupid.

I´m working on a simple web application containing only one page with some dialogs  ( JSF 2 + Primefaces )  as flow engine i´m using activit-cdi 5.10 .


Depending on the route through the process some primefaces dialogs have to appear (there is no page flow). Currently I´m using following source code which is attached as event listener to every user task ( create and complete  )

//RequestContext from PrimeFaces

public void showDialog(String dlg) {
        System.out.println("Opening dlg " + dlg);
        RequestContext.getCurrentInstance().execute(dlg + ".show()");

    public void hideDialog(String dlg) {
        System.out.println("Hiding dlg " + dlg);
        RequestContext.getCurrentInstance().execute(dlg + ".hide()");

<userTask id="usertask4" name="LoginDialog" activiti:formKey="dlg_login">
        <activiti:taskListener event="create" expression="#{controller.showDialog('loginDLG')}"></activiti:taskListener>
        <activiti:taskListener event="complete" expression="#{controller.hideDialog('loginDLG')}"></activiti:taskListener>

unfortunately i have to add the listener to every userTask

Is there a better approach ?

An other question is the partial update of a JSF 2 page.

Primefaces offers the possibility to perform a partial update of the page after a request. This is great as long the underlying process lasts one request. But if the process needs two or more request this feature becomes useless, because the partial update of the page gets invoked to early. At the moment I´m using a process variable which contains a list of all ids which have to be updated at the end of the request. Therefore I have to add a service task at the end of every process. Is there a better way to deal with this ?

Regards and thanks for activiti(-cdi) its always fun to work with