2 Replies Latest reply on Jan 24, 2012 11:36 AM by mark77

    jbpm 5.2 on JBoss 6 - User Registration "Quest"

    mark77

      Hi all,

       

      I am very new to jBPM and am kind of stuck in multiple places. I could really need some hints or links to relevant tutorials or so. So here's what I have and need:

       

      The environment is jbpm 5.2 on JBoss 6, the processes should be delivered in BPMN2. My first target is a user registration form. The idea is to have a user fill a JSF2 form containing his chosen username, password and email address (and captcha, but that already works). I now need to store these values to an external database and send (via the jBPM process) a confirmation email to the user. The user clicks a link inside the email and can continue his registration process by giving his address etc.

      Now these entered data is again stored in the external database and from now on, the user should be able to log in with his credentials. Further, now an administrator (whose credentials are also stored in the external database) has to log in and approve the account of the newly registered user, then the user is "fully qualified" and can e.g. regiister new services.

      The whole application is a maven2 project and jBPM should not be installed at the server but be bundled with the application (thus using LocalTasks - I think I got this running).

       

      For assigning the tasks to the user and administrator I think I found the solution to use an own usergroups.callback. But when I want to create the process and start the task, I get an SQL error because the foreign key to the organizationentity table is broken. (Of course it is, because users and all this stuff is managed externally and is not forwarded to the jBPM database).

       

      Next question is, how can I generate this email and send it to the user ? Do I have to write a task handler for sending this email and inserting the link and user's email address ?

       

      How can I get back from the confirmation-endpoint (where the emailed link points to) back to the task to complete it ?

       

      And finally - how can I include a ... whatever.... that automatically removes the pending confirmation tasks and assiciated data, if the user does not click the confirmation link within 3 days ?

        • 1. Re: jbpm 5.2 on JBoss 6 - User Registration "Quest"
          gardellajp

          Hi Markus,

           

          At first, I'm not speak english, so sorry my mistakes in the writing

           

          Next question is, how can I generate this email and send it to the user ? Do I have to write a task handler for sending this email and inserting the link and user's email address ?

          In BPMN 2, to this type of task you must use a Service Task. Check Domain-Specific processes. jBPM provide a built-in task for this purpose.

           

           

          How can I get back from the confirmation-endpoint (where the emailed link points to) back to the task to complete it ?

          You must build a link inside the mail that have the taskId that you want to complete it. This link will forwarded to some service that pick the taskId and with Human Task Api you can complete it.

           

           

          And finally - how can I include a ... whatever.... that automatically removes the pending confirmation tasks and assiciated data, if the user does not click the confirmation link within 3 days ?

          In theory with Time Event Boundary event, but jBPM don't have a built-in persistent timer. You can vote JBPM-3170, however in the issue you can find a workaround.

           

          Cheers,

          Juan

          1 of 1 people found this helpful
          • 2. Re: jbpm 5.2 on JBoss 6 - User Registration "Quest"
            mark77

            Hi Juan,

             

            thanks for your reply. If for sending out the confirmation email (containing the generated link) I have to use a Service Task, do you know where I can find some tutorial ? I found something concerning configuration of a jpbm mail service, but this somehow does not fit to the piccture I yet have.

             

            Further, I think I think the process will start with sending out the email and then going into a user task which needs to be completed by the user the email was sent to. But a task needs a group or a user to whom it is assigned. Where does this ID come from ?