8 Replies Latest reply on Nov 25, 2005 7:53 AM by kukeltje

    JBI and jBPM

    kukeltje

      Are there any ideas/developments in wrapping jBPM so it becomes available as a JBI SE?

      Id so I'd like to contribute some of my or my collegues time.

        • 1. Re: JBI and jBPM
          tom.baeyens

          one of the things i'm currently working towards is a jbpm session facade. that would be a good candidate to expose as a service engine on a jbi environment.

          for an early impression, see org.jbpm.JbpmFacade on the head of cvs.

          the difficulties (read: challenges) of wrapping that as a web service (or a WSDL for the purists;) are the following:

          * variables: some of the methods take a map of variables as input. how is the user going to express arbitrary java objects in xml ?
          * return values such as ProcessInstance or TaskInstance: what part of the object graph will be serialized to xml and how will the xml and schema look like for those jbpm domain model objects. e.g. are you going to fetch from the db and then serialize all the process variables to xml when a user asks to load a token...

          interesting

          i can't wait for your comments

          regards, tom.

          • 2. Re: JBI and jBPM
            kukeltje

            ok... the issues are:

            1. an xml representation of the task variables
            2. the meta information representation

            For 1 we can make some assumtions.

            a:
            Each element that is a simple type at the top level is a process variable with the same name as the label in the xml representation.

            b:
            Elements that only contain simple types are javatypes, where the child elements should be getters/setters with tha name of the child element

            c:
            Elements that contain complex types are treated as collections/maps/... Collections are treated as if they contain the same type of objects. This means that an elemen in xml cannot contain both complex types and simpletypes. This does not pose a problem to me.

            (personal remark: if 'documents' get this complex, they should not be stored in the process engine but in a dossier with a reference in the processengine)

            And now the beauty: afaik, jxpath could help out very easily here. Not completely sure but I'll have a look.


            Regarding point 2, the meta info. I would not support retrieving tasklists. Would you? Just:

            - start pi
            * * process name (always the latest!)
            * * initial variables

            - finish task
            * * pi number / hash reference
            * * taskinstanceid / hash reference
            * * variables
            * * transition
            * * ....

            - signal state
            * * pi number / hash reference
            * * tokenid / hash reference
            * * variables
            * * transition
            * * ....

            - .....

            <jbpm>
             <processinstance>hashtopi<processinstance>
             <reference>tokenreference/taskinstancereference</reference>
             <variables>
             <name>Ronald</name>
             <gender>Male</gender>
             <address>
             <street>somestreet 666</street>
             <postalcode>1234 ZZ</postalcode>
             <city>anywhere</anywhere>
             </address>
             <order>
             <orderline>
             <productnumber>1</productnumber>
             <items>6</items>
             </orderline>
             <orderline>
             <productnumber>3</productnumber>
             <items>2</items>
             </orderline>
             </order>
             </variables>
             <transition>ORDER</transition>
            </jbpm>
            
            just some thoughts... lets continue thinking


            • 3. Re: JBI and jBPM
              tom.baeyens

              for the variables, your xml proposal reminds me of the (spring-like & mc-like) beans xml format that i just implemented. that is quite generic.

              but i don't see yet how we can define the xml format of the jbpm objects that we return. maybe we could return the simplest form like

              <process-instance id="4" />
              <task-instance id="5" />


              and have separate methods for fetching the content of those elements... but that will decrease performance, right.

              do you think it is desirable to introduce something like the Assembler from jbpm 2 ? meaning that in the request, the user sends a kind of xsd that describes what the user would like to see as a return value... would that make sense to you ?

              regards, tom.

              • 4. Re: JBI and jBPM
                kukeltje

                I'm not keen on directly using the internal id's exposed to the outside.

                I'll have look at the spring-like & mx-like stuff. Where is it specifically?

                I miss the point regarding the

                but i don't see yet how we can define the xml format of the jbpm objects that we return. maybe we could return the simplest form like

                <process-instance id="4" />
                <task-instance id="5" />


                and have separate methods for fetching the content of those elements... but that will decrease performance, right.



                Regarding the Assembler..... I've never used let alone understood that. So I'll have a look again.

                imo jbpm should/could have it's own format. Conversion to a specific format is up to the user or the ESB or whatever. jBPM should not take care of that.

                • 5. Re: JBI and jBPM
                  kukeltje

                  btw, I already have a small working example. Is CVS stable again so I can check in some webapp changes?

                  • 6. Re: JBI and jBPM
                    tom.baeyens

                    cvs is not yet stable... almost there. hopefully this evening.

                    regards, tom.

                    • 7. Re: JBI and jBPM
                      tom.baeyens

                      maybe you should just check in what you have right now.

                      then i can refactor the webapp to the new services api.

                      regards, tom.

                      • 8. Re: JBI and jBPM
                        kukeltje

                        will do this weekend. I also have added a websale2 process to have several variables that will be displayed as a date, radiobutton, listbox, textarea in a custom webapp. This webapp is also in the tree under /src/resources/customWebapp.war with a context of /websale. The build files are also adapted.