1 2 Previous Next 27 Replies Latest reply on Mar 18, 2012 12:37 PM by qntrix

    No save option in Designer

    out_sider

      I want to include the Web designer that comes with jBPM in my application. As such I need to be able to open the designer with a process, edit it and save.

       

      I can open the process model but I'm not abel to save it because there is no save button.

       

      To open the process I simply use the folowing url:

       

      http://localhost:8080/designer/editor?profile=drools&uuid=48c51971-54bf-4939-9785-c2843b7d4c7a

       

      Which displays the bpmn2.0 model for the process with the id = 48c51971-54bf-4939-9785-c2843b7d4c7a

       

      In this demo http://vimeo.com/22033817 (2:08) it's possible to see a "save all changes" option...but I can't get that option to appear no meter what URL I use.

       

      So what URL shoudl I use in order to open a process diagram in the Web Designer but be capable of saving changes?

       

      Edit: When I try to access the standalone editor through:

       

      http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?assetsUUIDs=

       

      Gives me

       

      500 The call failed on the server; see server log for details

       

       

      Thanks in advance

       

      Solution: Needed to add &client=oryx at the end...

      Sorry for the truble

        • 1. Re: No save option in Designer
          eaa

          In your case you will need to use Guvnor's Embedded Editors and not the designer as a standalone app: http://ilesteban.wordpress.com/2010/11/23/guvnor-embed-assets-editor-in-your-application/

           

          Best Regards,

          • 2. Re: No save option in Designer
            out_sider

            Many thanks for the reply...but I didn't quite understand the diference between what I was doing and what you suggested...the link you provided uses the standaloneEditorServlet...so isn't it the same thing?

            • 3. Re: No save option in Designer
              eaa

              Sorry, I didn't see that you were also trying to invoke designer through Guvnor (the correct way).

              In your case, seems that you are missing some parameters in the URL you are using:

               

              http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?assetsUUIDs=HERE_GOES_THE_UUID&client=oryx

               

              Please try using this URL. If this still doesn't work, please post the error log you are getting in the app server you are using.

               

              Best Regards,

              • 4. Re: No save option in Designer
                out_sider

                It's working fine many thanks for the help.

                What I didn't know was that it was possible to interact with the designer using the JavaScript object added to the "window".

                 

                I hope this interaction helps me fixe the consecutive saving issue I'm having...when I save a process and try to save it again without refershing I get :"Unable to save this asset, as it has been recently updated by [guest]". Do you think it's possible to issue a refresh to the iframe through the JavaScript?

                 

                Thanks again


                • 5. Re: No save option in Designer
                  eaa

                  I faced the exact same problem. What I did was to attach a listener using registerAfterSaveAllButtonCallbackFunction and reloading the iframe where Designer was opened.

                  Hope it helps.

                   

                  Best Regards,

                  1 of 1 people found this helpful
                  • 6. Re: No save option in Designer
                    out_sider

                    Thanks for the quick replies.

                     

                    I found an issue when trying to access the window.guvnorEditorObject through the chrome console. If I try to retrieve the Asset ID by getAssetsUUIDs I get: TypeError: Cannot call method 'getAssetsUUIDs' of undefined.

                    For what I can uderstand the guvnorEditorObject is not defined in window...am I doing anything wrong?

                     

                    Best regards

                     


                    • 7. Re: No save option in Designer
                      eaa

                      guvnorEditorObject is defined in the window object of the iframe where Guvnor is opened.

                      For example, this is the way I'm getting the reference to this object:

                       

                      var guvnor = window.document.getElementById('guvnor_iframe_id').contentWindow.guvnorEditorObject;

                       

                      Best Regards,

                      • 8. Re: No save option in Designer
                        out_sider

                        Now that I can acess the contentWindow because the iframe parent is in the same domain I'm having another issue .

                         

                        By doing console.log(guvnor) I get the following information of the guvnorEditorObject:

                         

                         

                        Object

                         

                        1. afterCancelButtonCallbackFunction: null
                        2. afterSaveAndCloseButtonCallbackFunction: function (){console.log('ssssssssssssssaved')}
                        3. brlCallbackFunction: null
                        4. drlCallbackFunction: null
                        5. getAssetsUUIDs: function (){return c.Lg()}
                        6. getBRL: function (b){this.brlCallbackFunction=b;c.Mg()}
                        7. getDRL: function (b){this.drlCallbackFunction=b;c.Ng()}
                        8. registerAfterCancelButtonCallbackFunction: function (b){this.afterCancelButtonCallbackFunction=b}
                        9. registerAfterSaveAndCloseButtonCallbackFunction: function (b){this.afterSaveAndCloseButtonCallbackFunction=b}
                        10. __proto__: Object

                         

                        There is a "registerAfterSaveAndCloseButtonCallbackFunction" which receives as argument the function to call when the Save button is pressed. The problem is that it isn't calling the function.

                         

                        Things I've noticed:

                        In the Stand Alone Editor there isn't a Save and Close button but a Save All Changes button...as such it makes more sence to use the "registerAfterSaveAllButtonCallbackFunction" which you previously refered. Bu the guvnorEditorObject doesn't have such property.

                         

                        What can I do in order to refresh the iframe of the Stand Alone editor after saving?


                        • 9. Re: No save option in Designer
                          eaa

                          Which version of Guvnor are you using? I don't remember if I added this feature in 5.3 or 5.4

                           

                          Best Regards,

                          • 10. Re: No save option in Designer
                            out_sider

                            Sorry for the dumb question but how can I check the Guvnor version? I downloaded jBPM which brought the Guvnor Editor

                             

                            On the lib folder which has the .war I have "guvnor-distribution-wars-5.3.1.Final"...does that mean the 5.3 version?

                            • 11. Re: No save option in Designer
                              eaa

                              In guvnor, go to Administration section (left panel) -> About.

                              If you are using jbpm 5.2 then I think you are using guvnor 5.3.1, what means that I implemented the new callbacks functions in 5.4 .

                              Unfortunatelly, you will need to use this version if you want to use the new callback functions.

                              • 12. Re: No save option in Designer
                                out_sider

                                Can I use the 5.4 with jBPM? is it as simple as downloading the .war?

                                 

                                PS: It is 5.3.1 (just checked)

                                 

                                Thank you very much for all the prompt help

                                • 13. Re: No save option in Designer
                                  eaa

                                  Not sure if you can use it without any problem. But basically, what you can do is to download the latest snapshot .war and deploy it.

                                  Don't forget to share with us the results

                                   

                                  Best Regards,

                                  • 14. Re: No save option in Designer
                                    out_sider

                                    Very well...I'll be trying that tomorrow and I'll post the results.

                                     

                                    Where can I download the 5.4 version?

                                     

                                    As last resource I can always try to catch the Check in Save click event and refresh the iframe.

                                     

                                    Again many many thanks for the help

                                    1 2 Previous Next