14 Replies Latest reply on Apr 13, 2010 12:11 PM by Alexei none

    JPDL feature request

    Alexei none Apprentice

      My JBPM was shipped with following process definition

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process name="Order" xmlns="http://jbpm.org/4.3/jpdl">
      
        <start g="16,19,48,48">
          <transition to="receive confirmation" />
        </start>
        
        <state name="receive confirmation" g="96,16,136,52">
          <transition to="end" />
        </state>
        
        <end name="end" g="269,20,48,48"/>
      
      </process>
      

       

      So the first question is what is the version of jpdl above? Are there any UI editors for that version of jpdl? Are there any schemas?

       

      And a small feature request: is it possible to split single attribute g="96,16,136,52" into 4 separate attributes x="96" y="16" width="136" height="52" ?

      Why do I need it ? First of all, jpdl will be more obvious. Then I was going to create xslt to transform jpdl to svg with process image, but tokenizing g attribute requires some complicated logic (by the way, tokenize is only available fo xslt 2.0, for 1.0 you should use split). So, splitting g into separate attributes will simplify xslt a lot.

        • 1. Re: JPDL feature request
          HuiSheng Xu Master

          Hi Alexei,

            The schema of jPDL is included by the jBPM distribution file. You could get it from the http://sourceforge.net/projects/jbpm/files/。

           

            As you can see in the .jpdl.xml, the latest version is 4.3, so you can find out there is a file named jpdl-4.3.xsd in the src directory.

           

            The distribution file includes a Graphical Process Designer, it is a eclipse plugin, you could use it to design jPDL process definitions. You could find more information in the User Guide. http://docs.jboss.com/jbpm/v4/userguide/html_single/#graphicalprocessdesigner

           

            In my opinion, the season why jPDL didn't seperate the g="1,2,3,4" to x="1" y="1" w="1" h="1" is the transition could have more than one point in the g attribute, but I don't very clearly for that, maybe someone else could give us the reason for this.

          • 2. Re: JPDL feature request
            Alexei none Apprentice

            Thx for your attention. Well, lets look a little bit wider: what do you think about idea to generate svg process images directly from jpdl by means of xslt without eclipse gpd editor? Even look farther ahead: we can add to jpdl file something like

             

            <?xml-stylesheet type="text/xsl" href="../toSvg.xsl"?>

             

            to make jpdl viewable without jpdl editor

            • 3. Re: JPDL feature request
              HuiSheng Xu Master

              Hi Alexei,

                 I am not good at xslt, so in our project, we use java to generate the PNG image from .jpdl.xml.

               

                About the jpdl editor, we have developed a web-based jPDL designer. Likely the jBPM modeller, we using VML/SVG to draw process graphical in the brower.

              • 4. Re: JPDL feature request
                Alexei none Apprentice

                I guess, my xslt is even worse then yours

                I attached xslt to this post. You should download it and then add XSL processing instruction

                 

                <?xml-stylesheet type="text/xsl" href="toSvg.xslt"?>

                 

                to your jpdl file.

                Then your need view your jpdl file with any svg enabled browser i.e. firefox

                 

                Yep, it's still ugly but it's fully client-side image generation, i.e. you need no process image png or jpg anymore

                 

                I'm still working and gonna make it a little bit nicer & integrate it to my REST interface for JBPM

                • 5. Re: JPDL feature request
                  Alexei none Apprentice

                  By the way, I've just discovered that svg supports events & scripting . So you can get really rich client-side process preview.

                  • 6. Re: JPDL feature request
                    Koen Aers Master

                    This is a very interesting discussion guys! I like the svg approach of rendering the image, it is a lot cleaner than saving the image with the process. What about the performance though? Do you perform this xslt transformation to svg on the fly each time before rendering? Doesn't that take a lot of time?

                     

                    As for the 'g' attribute, this looks like it does because it has always been our focus to keep the jpdl xml concise and readable. As you might know the graphical info even used to be in another file in jBPM 3, with other drawbacks. Even if it would be advisable, it would be very difficult to split the 'g' attribute at this time because of backward compatibility issues and complications with the tools. We will be moving towards BPMN2 anyway for the next generation of jBPM (jBPM 5) and that standard is focused on diagrams and interchange of them.

                     

                    In the meantime, feel free to continue to suggest and contribute jBPM 4 improvements.

                     

                    Cheers,

                    Koen

                    • 7. Re: JPDL feature request
                      Alexei none Apprentice

                      Well, actually I was playing with a simple process definition consisting of 3 states and 2 transitions and my firefox was really fast. However, if I will get slowdown, I'll try to move transformation to server side.

                       

                      P.S. I hope firefox xslt 2.0 support will appear soon, then there will be no difference if g separated or not

                      • 8. Re: JPDL feature request
                        HuiSheng Xu Master

                        Hi Alexei,

                          Actually, I like SVG very much. But Sadly the IE does not support SVG, so it let SVG useless in my job. Hoping sometime IE could provide native SVG, then we could use SVG to draw graphical on every browsers.

                        • 10. Re: JPDL feature request
                          Alexei none Apprentice

                          Can anybody clear how g attribute relates to actual location & dimentions of visual block? If i'm not mistaken, first 2 numbers describe x & y coordinates of upper left conner for state blocks and circle's center for end & start blocks.

                          • 11. Re: JPDL feature request
                            Alexei none Apprentice

                            Just a small update, if anybody care

                             

                            Currently supported tags

                             

                            <svg:g>
                                <xsl:apply-templates select="//jpdl:transition"/>    
                                <xsl:apply-templates select="jpdl:start"/>
                                <xsl:apply-templates select="jpdl:end"/>
                                <xsl:apply-templates select="jpdl:state"/>
                                <xsl:apply-templates select="jpdl:hql"/>
                                <xsl:apply-templates select="jpdl:decision"/>
                                <xsl:apply-templates select="jpdl:join"/>
                                <xsl:apply-templates select="jpdl:fork"/>
                            </svg:g>
                            

                             

                            Still a lot of work with transitions. Works fast at least under firefox.

                             

                            And 2 screenshots: from Eclipse & from Firefox

                            • 12. Re: JPDL feature request
                              HuiSheng Xu Master

                              Hi Alexei,

                                The attribute g is 'x,y,width,height', the x part is equals as left, the y part is equals as top. There is no difference between start/end(with image) and other(without image) activities.

                              • 13. Re: JPDL feature request
                                Sebastian Schneider Master

                                I'm not really happy either with the way the coordinates are stored in the xml-file. One approach to change the process definition from using the g-attribute to single attributes for each coordinate while maintaining backwards-compatibility would be to add these attributes while keeping the g-attribute. Maybe just for a certain time to allow proper migration. Of course this means redundancy. We could define the g-attribute being the relevant one in case there is in inconsistent process definition in which coordinates differ.

                                 

                                Just my 2 cents.

                                • 14. Re: JPDL feature request
                                  Alexei none Apprentice

                                  update

                                   

                                           <svg:g>
                                                  <xsl:apply-templates select="//jpdl:transition"/>
                                                    <xsl:apply-templates select="jpdl:start"/>
                                                    <xsl:apply-templates select="jpdl:end"/>
                                                    <xsl:apply-templates select="jpdl:end-cancel"/>
                                                    <xsl:apply-templates select="jpdl:end-error"/>
                                                    <xsl:apply-templates select="jpdl:state"/>
                                                    <xsl:apply-templates select="jpdl:hql"/>
                                                    <xsl:apply-templates select="jpdl:sub-process"/>
                                                    <xsl:apply-templates select="jpdl:decision"/>
                                                    <xsl:apply-templates select="jpdl:join"/>
                                                    <xsl:apply-templates select="jpdl:rule"/>
                                                    <xsl:apply-templates select="jpdl:fork"/>
                                                </svg:g>