1 2 3 Previous Next 32 Replies Latest reply on Sep 7, 2012 1:43 AM by leaf-xue Go to original post
      • 15. understanding taskclient
        salaboy21

        That depends on your design. If you will execute processes that are scoped for all the application you can share a knowledgeSession for all the application. If you want to do specific tasks for an user, for example having per user set of rules and processes (not human tasks in your processes) you can create a statefulknowledgesession per user. It really depends on your scenario.

        Please, if you want to change the scope of the original question create a different thread/topic of conversation, so we can keep this forum ordered.

        Thanks!

        • 16. understanding taskclient
          diduch

          I HAVE A PROBLEM WITH AN EXAMPLE, THE SAME OF THIS VIDEO http://people.redhat.com/kverlaen/install-eclipse-jbpm.swf , IN THE PART WHEN ITS EVALUATE THE TASK HUMAN I REFRESH WITH THE NAME "Krisv" BUT IN THAT MOMENT I HAVE THIS MISTAKE: COULD NOT CONECT TO TASK SERVER: 127.0.0.1 PORT 9123... SOMEBODY... CAN YOU HELP ME.....

          • 17. Re: understanding taskclient
            echelon

            Hi

             

            I think of you were not start your jbpm server ! 

            • 18. understanding taskclient
              krisverlaenen

              It seems you don't have the task service up and running.  Did you use the jbpm-installer to install and start the demo setup?  After doing that, you should have your task service up and running.

               

              Kris

              • 19. understanding taskclient
                diduch

                THANKS.... THAT WAS THE PROBLEM... NOW SOMEBODY CAN HELP ME... I WANT TO SEND AN EMAIL BEFORE THE END OF THE EVALUATION EXAMPLE... BUT I HAVE THIS ERROR:

                COULD NOT ITEM HANDLER FOR EMAIL..

                I FILLED IN THE PROPERTIES THE PARAMETERS: TO, FROM, SUBJECT, BODY...

                 

                I WANT TO KNOW HOW SEND EMAILS... WHAT I NEED... THANKS...

                • 20. understanding taskclient
                  krisverlaenen

                  Take a look at the section on domain-specific processes in the documentation:

                  https://hudson.jboss.org/hudson/job/jBPM5/lastSuccessfulBuild/artifact/target/jbpm-5.1-SNAPSHOT-docs-build/jbpm-docs/html/ch07.html

                   

                  In short, you have to register a handler that will be used to execute your Email node.

                  In this case, you should make sure you have the jbpm-workitems jar on your classpath and add the following line after creating your session:

                   

                  EmailWorkItemHandler handler = new EmailWorkItemHandler(host, port, userName, password);

                  ksession.getWorkItemManager().registerWorkItemHandler("Email", handler);

                   

                  Kris

                  • 21. understanding taskclient
                    diduch

                    THANKS FOR YOUR HELP........ 

                    • 22. understanding taskclient
                      diduch

                      WHEN I DEBUG, THE FIRST STEP IS SELFEVALUATION, AFTER THAT I PUT A EMAIL SERVICE TASK, I WANT IN THIS POINT SEND AN EMAIL AND AFTER THAT CONTINUE WITH THE REST OF THE PROCESS, BUT ITS STOPING IN THE EMAIL AND DONT SEND ANYTHING... HOW CAN I EXECUTE THE EMAIL... I FILL THE PORT, HOST, USER, PASSWORD, IN THE EMAILWORKITEMHANDLER, BUT I DONT KNOW IF THIS HAVE TO SEND AS PARAMETER IN THE EMAIL SERVICE TASK... HOW CAN I COMPLETE THIS SERVICE TASK....

                      • 23. understanding taskclient
                        salaboy21

                        Hi, you need to bind a workItemHandler implementation to your knowledge session doing something like:

                        ksession.getWorkItemManager().registerWorkItemHandler("Email", <your email sender implementation WorkItemHandler>);

                         

                        Then, when you run your process the workItemHandler registered will use the properties that you set in the designer to send the email.

                        Greetings.

                        • 24. Re: understanding taskclient
                          diduch

                          I AM WORKING WITH THIS... IN THE PROPERTIES OF THE EMAIL SERVICE TASK, I FILLED TO,SUBJECT,FROM AND BODY... WHEN I RUNNING DE PROCESS IN DEBUG.. THE PROCESS COMES TO THE EMAIL TASK BUT DONT SEND THE EMAIL AND DONT PASS TO NEXT USER TASK....

                           

                          public static final void main(String[] args) {

                                  try {

                                      // load up the knowledge base

                                      KnowledgeBase kbase = readKnowledgeBase();

                                      StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

                                      KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "test", 1000);

                                      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());

                                      // start a new process instance           

                                      Map<String, Object> params = new HashMap<String, Object>();

                                      params.put("employee", "krisv");

                                      EmailWorkItemHandler handler = new EmailWorkItemHandler("smtp.gmail.com", "465", "user@gmail.com","password");

                                      ksession.getWorkItemManager().registerWorkItemHandler("Email", handler);

                                      ksession.startProcess("com.sample.evaluation", params);   

                                      logger.close();

                                  } catch (Throwable t) {

                                      t.printStackTrace();

                                  }

                              }

                           

                              private static KnowledgeBase readKnowledgeBase() throws Exception {

                                  KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                                  kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2);       

                                  return kbuilder.newKnowledgeBase();

                              }

                           

                          I THINK THAT I NEED SOME ACTION FOR EXECUTE THE EMAILWORKITEMHANDLER ON ENTRY ACTIONS IN EMAIL TASK SERVICE..... THE IMAGE SHOWS MY WORKFLOW...

                          • 25. understanding taskclient
                            diduch

                            I HAVE THE WORKFLOW RUNNING BUT WITH AN IMPLEMENTATION OF WORKITEMHANDLER CALLED NOTIFICATION... THIS RUN VERY WELL... BUT I WANT TO KNOW... HOW USE EMAILWORKITEMHANDLER BECAUSE WHEN I USE THAT... IT DONT SEND THE EMAIL AND IT DONT COMPLETE THE TASK.. THE WORKFLOW IS STOPING IN THAT POINT AND I DONT HAVE ANY MISTAKE IN CONSOLE... I CONFIGURE THE drools.email.conf in jbpm-workitems.jar BUT NOTHINGS HAPPEN.. DONT SEND EMAIL...

                            • 26. understanding taskclient
                              salaboy21

                              Hi there,

                              the problem is usually the mail server that you are using. I saw in the screenshot that you are using GMAIL servers? GMail server work with encrypted authentication and it's not easy to send an email through them. you should check the Java Mail APIs in order to be able to connect more advanced mail servers. If you install your own mail server on your computer it will probably work in the way that you configure it but for third party and secure server you will require more advanced configurations. This is not a jBPM5 problem, it's just a Java + Emails configuration that are requiered for every Java Application.

                              Hope it helps

                              • 27. understanding taskclient
                                diduch

                                THANKS.... FOR YOUR HELP....

                                • 28. understanding taskclient
                                  diduch

                                  HOW CAN I OBTAIN THE USERS OF A GROUP.... AND HOW CAN I ADD A USER IN A GROUP... IN WHAT TABLE CAN I SEE THAT... JBPM4 HAD THE MEMBERSHIP TABLE.... FOR EXAMPLE:

                                   

                                   

                                  GROUPS: G1, G2

                                  USERS: USER1, USER2, USER3

                                   

                                  I WANT TO THE GROUP G1 HAS USER1 AND USER2 AND IN THE ANOTHER GROUP THE USER3

                                   

                                  WHEN I HAVE A TASK I WANT TO IN THE GROUP G1, ONE OF ITS MEMBERS CLAIM FOR THE TASK... I THINK....I HAVE TO PUT THE NAME OF THE GROUP IN SWINLANES OR GROUPID

                                   

                                  I WANT TO MAKE THIS IN THE ECLIPSE-DROOLS...

                                   

                                  IN THE EXAMPLE OF JBPM5 IN THE ORGANIZATIONALENTITY TABLE ARE GROUPS LIKE Knights Templer OR Crusaders. IF IN A HUMANTASK I PUT IN THE SWIMLANE OR GROUP ID Crusaders... THE TASK IS FOR THIS GROUP BUT I DONT KNOW... WHO ARE IN THIS GROUP.. FOR SOMEBODY TAKE THE TASK.... IN WHAT TABLE CAN I SEE THIS RELATION BETWEEN USERS AND GROUPS... HOW CAN I ADD AN USER IN A GROUP...

                                  • 29. understanding taskclient
                                    slelarge

                                    Hi Diduch,

                                     

                                    I am surprised that nobody gave you an answer.

                                    Actually, I am facing the same problems. I don't see how to use the groupId logic while we are not able to set/get group members...

                                     

                                    Any help will be appreciated