1 2 Previous Next 29 Replies Latest reply on Nov 8, 2013 7:27 AM by arunkrishna Go to original post
      • 15. Re: Jbpm 5 user form variables
        bpmn2user

        It really does not matter how you name, 'map' or 'myMap' , but you need to add the variable 'map' as explained in http://community.jboss.org/thread/161936?tstart=0.

         

        Attached please find the modified bpmn file for your example and it should work for you.

        • 16. Re: Jbpm 5 user form variables
          bpmn2user
          • 17. Re: Jbpm 5 user form variables
            a.kushunin

            Hi community!

            Is it possible to pass objects via Content variable to the human task.

             

            As I can see in example everywere people use strings.

             

            I tried to create Map<String, Object>, put some parameters there, but, when I try to deserialize content of the task I'm getting string, like {param1 = value1.toString ...} etc.

             

            So we can pass objects (I mean custom classes) as varables into the process, but can't get them back in hyman task content.

             

            Is there any possibility to pass objects as human task parameters?

            • 18. Re: Jbpm 5 user form variables
              calca

              Hi!

               

              How are you defining the Content input for the task into bmpn?

               

              Demian

              • 19. Re: Jbpm 5 user form variables
                a.kushunin

                Hi, Demian!

                 

                First, in script task I'm creating map like this:

                 

                Map<String, Object> content = new java.util.HashMap<String, Object>();

                content.put("employee", employee);

                //Where employee is my class passes into the process as parameter;

                kcontext.setVariable("content", content);

                 

                Than, in Jboss Tools bpmn editor in properties of HumantTask I'm setting #{content} value to Content propety;

                 

                WBR, Aliaksei

                • 20. Re: Jbpm 5 user form variables
                  calca

                  Hi again!

                   

                  Well, the problem is that the expressions are evaluated as string.

                   

                  You can assign directly process variable to human task variable. I don't know if the editor will allow it, but you can try, instead of using "Content" section, using Parameter Mapping, and define variable "Content", to be filled with "content" process variable.

                   

                  Hope this helps,

                   

                  Demian

                  • 21. Re: Jbpm 5 user form variables
                    a.kushunin

                    If I use parameters mapping  for task, and add parameter Content KnoledgeBase fails to compile with error, that 2 inputs with name Content defined...

                     

                    As a workaround I can create method which will serialize my content into String and than I can deserialize it in my code when get content of the task. But this aproach I don't want to use because of perfomance lag.

                     

                    Any more idias?

                     

                    BR Aliaksei.

                    • 22. Re: Jbpm 5 user form variables
                      calca

                      You can edit directly the bpmn and define only one content so you don't have two inputs with the same name:

                      <dataInputAssociation>

                              <sourceRef>content</sourceRef>

                              <targetRef>_17_ContentInput</targetRef>

                            </dataInputAssociation>

                       

                      Or the other option, simpler, is to leave Content empty, and define another variable name (in Parameter Mapping) for your content. If Content is empty, the input our your task will be all the parameters you define.

                       

                      Demian

                      • 23. Re: Jbpm 5 user form variables
                        a.kushunin

                        Hm, maybe I forgot to mentionet, that I'm retriving content of the task through :

                         

                        client.getTask(taskSummary.getId(), taskResponseHandler);

                        org.jbpm.task.Task jBMPTask = taskResponseHandler.getTask();

                        TaskData taskData = jBMPTask.getTaskData();

                        client.getContent(taskData.getDocumentContentId(), contentResponseHandler);

                        Content content = contentResponseHandler.getContent();

                        ByteArrayInputStream bais = new ByteArrayInputStream(content.getContent());

                        ObjectInputStream ois = new ObjectInputStream(bais);

                        Object vars = ois.readObject();

                         

                        vars - is always String. If I left Content field blank - I'm getting just empty string.

                         

                        If I manually edit bpmn file all works fine, and I'm getting objects, but it's not an option, to edit files manually every time )-:

                        • 24. Re: Jbpm 5 user form variables
                          a.kushunin

                          Hi, Demian!

                           

                          I spotted following problem:

                          If I pass objects througth Content varialble via variables mapping jBPM engine starts working mega slow, e.g. after process start tasks appears in process DB after about 30-45 seconds, and work with task became real hell. Task status change waits about 1 minute.

                           

                          Did anybody spotted such problems? Any ideas why?

                          • 25. Re: Jbpm 5 user form variables
                            a.kushunin

                            Find out the solution.  Problem was not configured mina logging - some jars were in conflicht, after resolwing conflich all works fine (-:

                            • 26. Re: Jbpm 5 user form variables
                              shahdhaval2020

                              Can you plz keep the complete example with screen shots in one page or can you plz provide us with running projects zip file so that we can under stand nicely jbpm.

                               

                              i am new to jbpm .... and still confused with this bpmn thing .....

                               

                              your help would really be helpful to me

                               

                              i visted this page :- https://community.jboss.org/people/bpmn2user/blog/2011/02/21/jbpm5-example-for-forms-with-variables

                               

                              but still i am not able to resolve it or get it so plz ..... since i am new to this that's y .... and also i am a fresher . and its company's requirement ...plz

                               

                               

                              can we make a standalone application in jbpm ....if you have idea on this than plz let me know.......... How to make a standalone application in JBPM ...an example on that will also be appreciated

                              • 27. Re: Jbpm 5 user form variables
                                ajaxphagura

                                I'm trying to use the designer to set a process variable as the Actor using (#{name} where name is a string process variable). Now when I start the process using the jBPM Console I see the task being created under the user "name" but I'm unable to open the task form.

                                 

                                I have read this thread but don't know how to make it work. Do I have to create a map? Thx!!

                                 

                                Using jBPM 5.4.

                                • 28. Re: Jbpm 5 user form variables
                                  ouadi_dev

                                  I'm also blocked with this problem, can any one help me to resolve it !!

                                   

                                  The problem is described in tis thread :

                                   

                                  https://community.jboss.org/message/804254

                                  • 29. Re: Jbpm 5 user form variables
                                    arunkrishna

                                    Hi,

                                     

                                    Can u provide the java code to it

                                    1 2 Previous Next