1 2 Previous Next 16 Replies Latest reply on Jul 4, 2007 4:41 AM by kukeltje

    jBPM or pages.xml overloading / extending / composition

    utiba_davidr

      Hi,

      I have a query regarding jBPM and Seam. Essentially what I want to know is, if I have a defined process or page flow using either jBPM or standard pages.xml is it possible to extend or customize that flow elsewhere? Is this addressed now in Seam 2.0 (I read about page flow composition support..)?

      For example, say I have a page that has the outcomes: "delete" or "modify" and a particular client wants to have their version of the software allow a new outcome of: "activityLog". How would I achieve this? Ideally what I would like is to setup a product level page flow and then simply extend that to include the new outcome. What I want to avoid at all costs is "copy and pasting" the page flow. Is this achievable by designing the page flows properly? Or is it only achievable by writing some sophisticated XML merging utility perhaps? It would also be good to say, remove or disable certain outcomes if a client wishes.

      Thanks,

      David

        • 1. Re: jBPM or pages.xml overloading / extending / composition

           

          utiba_davidr
          Joined: Sat Jun 23, 2007 08:52 AM

          First of all: welcome to the JBoss forums. The subject of your question is promising!

          But...

          I don't know about the other members, but in general I have a strong objection against posting the very same question in multiple forums. A usenet-like "cross-posting" might be alright to some, but is different than posting the very same thing as separate topics in multiple forums. The latter implies that people might spend their time typing the very same answer that someone else already gave elsewhere. Or, for your own benefit: it may also imply that wrong answers are not noticed by people who only read the topic in the other forum(s).

          So, I guess this very topic should continue at the very same topic in the Seam forum, in which a few replies have already been given, posted Wed Jun 27, 2007 23:35 PM.

          Cheers,
          Arjan.

          • 2. Re: jBPM or pages.xml overloading / extending / composition

            Oops, excuse me for my previous reply. I did not yet dive into the posts in the Seam forum, and apparently in that specific topic you and Gavin King decided that this question was better asked in the jBPM forum -- and you even linked here. Good!

            So: I hope you'll find your answer here. At least my erroneous comments make your topic move up in the list of topics...

            Sorry,
            Arjan.

            • 3. Re: jBPM or pages.xml overloading / extending / composition
              kukeltje

              Don't know about extending and overloading but pageflow composition (http://jira.jboss.com/jira/browse/JBSEAM-157 ?) would be an option. What I personnaly would like is a dynamic processcomposition. This way you can have one big main process, but runtime decide which subprocess to load for a specific user. Would that solve your problem or would overloading/extending of subprocesses still be required?

              • 4. Re: jBPM or pages.xml overloading / extending / composition
                damianharvey

                Dynamic process composition would be very useful. Is this something that is being worked on? Is there any way to achieve the same effect with the current release?

                Thanks,

                Damian.

                • 5. Re: jBPM or pages.xml overloading / extending / composition
                  kukeltje

                   

                  "damianharvey" wrote:
                  Dynamic process composition would be very useful. Is this something that is being worked on?
                  No
                  "damianharvey" wrote:

                  Is there any way to achieve the same effect with the current release?

                  No, not as far as i know

                  Please file a jira issue for this.



                  • 6. Re: jBPM or pages.xml overloading / extending / composition
                    kukeltje

                    Correction.... there is something like a customsubprocessresolver... that can be used to achieve this. Look at the testcases in the source!!!

                    • 7. Re: jBPM or pages.xml overloading / extending / composition
                      kukeltje

                      But.... see

                      http://jira.jboss.com/jira/browse/JBPM-1004

                      I already implemented this... committing will be tonight

                      • 8. Re: jBPM or pages.xml overloading / extending / composition
                        kukeltje

                        if you want it now, apply this patch to the source of 3.2.1

                        ### Eclipse Workspace Patch 1.0
                        #P jbpm.3-clean
                        Index: jpdl/jar/src/main/java/org/jbpm/graph/node/ProcessState.java
                        ===================================================================
                        RCS file: /cvsroot/jbpm/jbpm.3/jpdl/jar/src/main/java/org/jbpm/graph/node/ProcessState.java,v
                        retrieving revision 1.3
                        diff -u -r1.3 ProcessState.java
                        --- jpdl/jar/src/main/java/org/jbpm/graph/node/ProcessState.java 15 Nov 2006 12:51:07 -0000 1.3
                        +++ jpdl/jar/src/main/java/org/jbpm/graph/node/ProcessState.java 28 Jun 2007 13:04:57 -0000
                        @@ -62,6 +62,7 @@
                         import org.jbpm.graph.exe.Token;
                         import org.jbpm.graph.log.NodeLog;
                         import org.jbpm.graph.log.ProcessStateLog;
                        +import org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator;
                         import org.jbpm.jpdl.xml.JpdlXmlReader;
                         import org.jbpm.jpdl.xml.Parsable;
                        
                        @@ -147,9 +148,14 @@
                         ) {
                         SubProcessResolver subProcessResolver = getSubProcessResolver();
                         List attributes = new ArrayList();
                        - attributes.add(new FlyweightAttribute("name", subProcessName));
                        + String subProcessNameResolved = (String) JbpmExpressionEvaluator.evaluate(subProcessName, executionContext);
                        + if (log.isDebugEnabled()) {
                        + log.debug("SubProcessName after eval: " + subProcessNameResolved);
                        + }
                        + attributes.add(new FlyweightAttribute("name", subProcessNameResolved));
                         Element subProcessElement = new DefaultElement("sub-process");
                         subProcessElement.setAttributes(attributes);
                        +
                         usedSubProcessDefinition = subProcessResolver.findSubProcess(subProcessElement);
                         }
                        
                        


                        • 9. Re: jBPM or pages.xml overloading / extending / composition
                          kukeltje

                          ahh... what the h.... already committed, INCLUDING a testcase

                          • 10. Re: jBPM or pages.xml overloading / extending / composition
                            damianharvey

                            Thanks. Speedy stuff.

                            • 11. Re: jBPM or pages.xml overloading / extending / composition
                              kukeltje

                              This is all due to the very flexible design of jbpm (and it will be even better for the 4.0 release). Docs still need updating though... (but that is also true for the late binding etc..

                              • 12. Re: jBPM or pages.xml overloading / extending / composition
                                kukeltje

                                uhmm... one thing... this is only for subprocesses in jpdl... not for pageflow yet!!!

                                • 13. Re: jBPM or pages.xml overloading / extending / composition
                                  utiba_davidr

                                  Does this mean that there is not as yet a solution to my problem? Or does it mean I should tackle my problem differently in the mean time? If so, would you be able to kindly provide an example of how you would tackle based on the following scenario:

                                  At the product layer we have say, a page that allows you to update a customers details. The outcomes are "update", "delete" and "view history". A particular client wants to redefine the process and page flow slightly: They want to; add a new outcome to the page "add note", remove an outcome "view history" and modify the process/page flow for the delete outcome to capture a deletion reason (so, an interim page in the flow for that other process). Essentually:

                                  Change:

                                  /user_info.seam
                                   -> update
                                   -> delete
                                   -> confirm (/delete_user_confirm.seam)
                                   -> view history (/view_user_history.seam)


                                  To:

                                  /user_info.seam
                                   -> update
                                   -> delete
                                   -> delete reason (/site/delete_user_reason.seam)
                                   -> confirm (/delete_user_confirm.seam)
                                   -> add note (/site/add_user_note.seam)


                                  It's a fairly stupid example, and would probably be tackled differently/better in a real layout - But, the example demonstrates all layers that I need to be able to override.

                                  Cheers,

                                  David


                                  • 14. Re: jBPM or pages.xml overloading / extending / composition
                                    utiba_davidr

                                    Also, thanks for being so helpful and responsive. Sorry to have taken so long to respond, things have been a little hectic.

                                    Cheers,

                                    David

                                    1 2 Previous Next