5 Replies Latest reply on Dec 7, 2007 11:18 AM by kukeltje

    How hard to create visual representation of the relationship

    joe_jboss

      Management is all about pretty pictures and that's one of the reasons they like the BPM. (They may not understand the details of the pictures but it gives us a place to start when discussing application behavior) The JBoss designer does a good job of letting us creating pretty pictures for individual flows but we'd like to have a master picture of how the flows are wired together. (60+ flows in a 4 deep graph) So, what would be the best way to try and build this picture? I can think of a couple options.


      1) Draw it manually in Visio using the .jpg files.

      2) Create a small program that loads the process definitions, calculates the defined relationships and generates an XML file that describes the relationships with references to the .jpg files. Then we use some other code or tools to convert the XML into an object graph.

      3) Create a medium size program that loads the process definitions and creates a single unified process instance including some new transition type between the different process definitions. This could use the standard API to construct a new definition. What API would write out a process Instance as a definition that could be then loaded into the builder.

      4) Try and modify the Eclipse plugin to support the loading of a whole directory of process definitions so that it could create a temporary unified graph. I don't know how much work this is. Is there any readily available API in the builder to do this?

      5) Use something that already exists that we haven't found through our investigaton.

      6) Some other, hopefully simpler approach than any of the above.

      We're open to any suggestions

        • 1. Re: How hard to create visual representation of the relation
          aguizar

          I'd go for (3). The API you are looking for is org.jbpm.jpdl.xml.JpdlXmlWriter. The problem is, this class is deprecated because there is no real need for it. You might as well build a DOM tree instead of a process definition object.

          Here is a first attempt at the algorithm for your program:

          For each process definition p:
          Look for a node n in the target document whose name matches the name of p
          If n does not exist, create it
          For each subprocess sp in p:

          Look for a node sn in the target document whose name matches the name of sp
          If sn does not exist, create it
          Create a transition from n to sn
          No need for recursion, because you are iterating over all process definitions. If you know the "root" processes beforehand, you can develop a version of this algorithm that probably performs better.

          Hope this helps.

          • 2. Re: How hard to create visual representation of the relation
            kukeltje

            and then use an autolayout algorithm (please send it to Koen then as well since he desperately wants one) to have a nice picture

            • 3. Re: How hard to create visual representation of the relation
              joe_jboss

              So for approach number 3.

              Load the process definitions
              Build a unified process definition in memory.
              Write the unified process definition to the correct form of XML.

              So how do I get the XML format correct for the jpdl builder if I dont use JpdlXmlWriter since its documented as never finished. What classes does the JPDL use to write out the process definition. What would be the starting place for writing out the positioning xml?

              Thanks

              • 4. Re: How hard to create visual representation of the relation
                joe_jboss

                I created a little program that stitches all of our process definitions together into a single summary view. The auto layout piece is pretty bad but its not worth the time for us to fix it.

                We have one large process with many subprocesses. The document that resulted from the above program drove us to create two unit tests. One unit tests verifies that a subprocess definition exists with the same name as that referred to by each process state. Another test verifies that each flow is referred to by at least one other flow in either an "in" or "out" relationship.

                • 5. Re: How hard to create visual representation of the relation
                  kukeltje

                  positioning is not done by jbpm, but by the elipse GPD and then GEF, not the GPD itself.