4 Replies Latest reply on Jul 22, 2014 9:48 AM by Solenn Kervoas

    Trying to configure the Email service task in jBPM 5.4

    Andy McC Newbie

      I'm trying to use the built-in Email service task and have been referring to https://community.jboss.org/message/793190#793190 for guidance.

       

      However, probably because I'm a newbie, I'm having trouble getting it working and wondered if anyone could help me answer the following:

       

      1. The above link provides an example of how to write a test case
        • Can anyone confirm that the code snippet available at the link should actually work? (I can't get it to work and have attached my bpmn and test code, although they are essentially the same as the link)
        • If I wasn't defining a test case, how should I invoke the setConnection method?
        • Do I add code to the "On Entry Action" of my Email activity, i.e. embed the setConnection call into the BPMN definition somehow?
        • If so, can anyone offer some example code?
      2. Part of the problem may be that I'm using a gmail account. Has anyone successfully set one of these up recently? (My account is new and I've obtained an application specific password for use with jBPM)
      3. Newer versions of the jars used by the Email task are available (activation-1.1.jar, mail-1.4.jar). Should these be used instead?
      4. Is the built-in Email service task essentially the same as the one provided by Kris V at http://people.redhat.com/kverlaen/repository/Email/? If so, should I be using that instead?

      Many thanks,

       

      Andy McC

       

      PS The editor seems to have done random things with the fonts in the posting. Sorry.

        • 1. Re: Trying to configure the Email service task in jBPM 5.4
          Andy McC Newbie

          I've now got it working.

           

          From the Javamail documentation it appears there was a gmail specific fix and adding the latest jars (activation-1.1.1.jar and mail-1.4.7.jar) to my buildpath means that the Email service task now works.

           

          Would still appreciate any advice on the other items (esp how to invoke setConnection as part of the BPMN specification).

          1 of 1 people found this helpful
          • 2. Re: Trying to configure the Email service task in jBPM 5.4
            Kannan g krishnan Newbie

            Hi

             

            I am also trying to configure the email in my workflow design. I have also included the jars that you mentioned in your last post. But no error or no response found, even the workflow not completed.

            Help me....

             

            Regards

            KANNAN

            • 3. Re: Trying to configure the Email service task in jBPM 5.4
              Jeewani Lakshani Newbie

              Hi,

              I am using JBPM 6 and i am also trying to configure email service task.  but it is different with jbpm 5.4 and can any one assist me to where to add the code which is defined in https://community.jboss.org/message/793190#793190.

              should the code add to the work item definition --> work definition or some other place?

              and do i need to do any changes to the properties of email service task?

              Please assist me soon since i am a newbie and i need to get this done soon.

              Thank you in advance

              • 4. Re: Re: Trying to configure the Email service task in jBPM 5.4
                Solenn Kervoas Newbie

                Hi,

                 

                There are different ways to make the Email Task Service work in jBPM 5.4.

                 

                * if you are using Eclipse, you can add the piece of code (see https://community.jboss.org/message/793190#793190) in the Java source file that starts the process (for instance, when you create a new jBPM project, Eclipse proposes to add a sample JUnit test or a sample Java class to execute the process).

                 

                * still under Eclipse, if you do not want to add that piece of code, you can create a folder named META-INF. Create two new files in that folder : drools.session.conf and WorkItemHandlers.conf. See the provided screen shot for more details.

                 

                * if you are using the jBPM console to execute your process, you get an error "Could not find work item handler for Email". To fix that error, you need to change the content of the file WEB-INF\classes\META-INF\CustomWorkItemHandlers.conf in your \jbpm-installer\jboss-as-7.1.1.Final\standalone\deployments\jbpm-gwt-console-server.war. Just add the following line to CustomWorkItemHandlers.conf, with your own details :

                 

                "Email" : new org.jbpm.process.workitem.email.EmailWorkItemHandler("smtp.host.fr", "587", "myaddress@host.fr", "mypassword"),


                Hope this helps.