3 Replies Latest reply on Sep 16, 2010 8:54 AM by francis1972

    Drawing process graph programmatically

    francis1972

      Hi all jBPM users,

      I have the requirement to build a process dynamically because the number of states in the process can be chosen

      by the end user. Arranging a simple routine for building the process XML is easy, anyway what about the process graph ?

      if the user wants to check visually where is the active Execution ? is there any jBPM/Java Api that can help me to draw the process graph ? (I imagine that the hardest task is generating the XY coordinates of nodes.......)

      Thanks a lot

      Francis

        • 1. Re: Drawing process graph programmatically
          jimmyb82

          You could check out the source for the GPD which is what I use in Eclipse to define my jPDL and it automatically creates a png copy of it.

          It does rely on the x,y,w,h co-ordinates though which probably will be the hardest bit.

          Unless the processes are simple a->b->c->d then I would investigate employing a diagram layout algorithm. Check Google for some answers.

          You could also use alternate tools to generate a BMPN diagram and then import it but I don't know if that would fit with your project.

           

          James

          • 2. Re: Drawing process graph programmatically
            achitaley

            Refer this post. It contains the entire code to generate image of Current Stage of a Process Instance.

             

            http://community.jboss.org/thread/155492

             

            Adwait Chitaley

            • 3. Re: Drawing process graph programmatically
              francis1972

              Hi James,Adwait

              thank you for your valuable contribute. I've checked the source code which can be used to generate at runtime the process graph.

              It's a great piece of information- unfortunately I'm missing the X,Y coordinates since the process graph is generated at runtime.

              I think there should be some libraries which can calculate the process coordinates based on an abstract set of nodes and transitions;

              Should I find anything, I'll post on this thread some news.

              Thanks again

              Francis