1 2 Previous Next 16 Replies Latest reply on Mar 15, 2010 9:20 AM by maxandersen

    Tutorial for BPEL simple-invoke

    peterj

      I am looking at the BPEL tools and having a difficult time using the GUI editor to recreate the simple-invoke example from RiftSaw. I have successfully followed the video and PDF for creating a simple echo BPEL process. But the neither the docs nor the video cover how to use the GUI to define a wrok flow that invokes an external web service. And needless to say, the steps to incorporate the invoking of an external web service are not obvious.

       

      Is there a tutorial that shows how to create simple-invoke, or something like it, using the GUI editors? I have googled and even on the Eclipse web site the only tutorial I found showed the bpel text being edited durectly (no GUI involvement).

        • 1. Re: Tutorial for BPEL simple-invoke
          dgolovin
          Have you seen this document JBoss BPEL User Guide? I've never went throug this document but it could give you some ideas.
          • 2. Re: Tutorial for BPEL simple-invoke
            grid.qian

            Hi Peter,

            I think Denis's answer is ok for you. You should read the document of JBoss BPEL editor. And for your case, you want to create simple-invoke sample project. You should do as these steps:

            1 create a bpel project named simple-invoke, and so on.

            2 import the files in bpelContent folder of the riftsaw simple-invoke sample into the folder ‘bpelContent' of the eclipse simple-invoke project.

            3 create a server in eclipse. The server has included riftsaw.

            4 deploy the bpel project into server.

            5 use the soapui or eclipse web service explorer to test the bpel.

             

            Anyway, you need to read the bpel editor document at first.

             

            Grid

            • 3. Re: Tutorial for BPEL simple-invoke
              peterj

              Yes, I hvae gone through that document (it is the PDF that I mentioned in my original post) - it creates only a simple echo BPEL process. And the steps that Feng supplied are too simplistic and just plain incomplete - if it were that easy even an idiot like me could figure it out .. Getting the external wsdl incorporated into the BPEL process is not easy. With a lot of trial and error I finally got a working BPEL, but I had to do a lot of text editing to get there. Also, I think that there are a few bugs that prevent the GUI from creating a proper BPEL. I plan to repeat the steps I took, taking into account everything I learned via trial and error. I will post my observations.

              • 4. Re: Tutorial for BPEL simple-invoke
                grid.qian

                Haha, maybe what I wrote is too simple. For simple-invoke sample, it include two parts: one is a web service, one is bpel.

                So we need to do more things.

                You should copy the war files into the correcty location in a dynamic project, then deploy it into server. It will create a web service in server

                Then do the steps like as I said in my last comment.

                Of course, in the future, we will create bpel project examples in eclipse side. You can import them directly into eclipse workspace, then test them.

                But for now. you need do something by yourself.

                If any questions, please feel free to comment this topic.

                 

                BTW welcome your advices.

                • 5. Re: Tutorial for BPEL simple-invoke
                  maxandersen

                  You should copy the war files into the correcty location in a dynamic project, then deploy it into server. It will create a web service in server

                  What does "correctly location" mean ?

                   

                  What does "dynamic project" mean ? Ear, War, BPEL ?

                   

                  And why do we suggest manually copying WAR files into these when WTP has support for including war's into project s?

                  • 6. Re: Tutorial for BPEL simple-invoke
                    peterj

                    Success! Yesterday I spent several hours, armed with the simple-invoke example, the JBoss Tools BPEL User's Guide and the mistakes that I make on an earlier attempt, and I successfully used the GUI editor to create a BPEL that invokes a web service. I took copious notes and screen shots (12 pages with 17 screen shots). My notes do not include any of the steps already documented in the User's Guide.

                     

                    Here is a very high-level overview of the steps:

                     

                    1) Create a project following chapter 3 in the User's Guide (but ignore the steps related to the Assign task at the start of section 3.2)

                    2) Copy the WSDL for the external web service into the project.

                    3) Add a partner link type with a role to the external WSDL

                    4) Add a partner link to the BPEL using the partner link type created in the prior step, and select the partner role

                    5) Add 2 variables to the BPEL - one for the external web parameters and the other for the return value

                    6) Add two Assign tasks to the BPEL work flow. In the first copy the BPEL input value(s) to the variable for the external web service parameters, and in the second do the same for the return value.

                    7) Add an Invoke task to the BPEL workflow (between the 2 Assigns added in the prior step), configure it to invoke the external web service and hook up the input and output variables

                    8) Follow the steps in the User's Guide, chapter 4, to add the PDE deployment descriptor to the project. But also identify the external web service partner link in the outbound interfaces

                     

                    Now you can deploy the BPEL project (chapter 4 of the User's Guide) and test it using SoapUI.

                     

                    The really interesting parts are steps 3 and 4. If you do step 4 without first doing step three you end up with problems that cannot be fixed by the GUI - you will need to edit the files in text. In fact, there are many situations where if you mess up the error cannot be corrected in the GUI.

                     

                    Step 6 was also a challenge. Determining which of the various matches, on the Choose Type of Variable dilaog box, to select when copying the variable values was not obvious.

                     

                    Step 3 required some manual editing of the WSDL file - the namespace for the partnerlinktype that was provided in the extenstion dialog was for xmlsoap not for wsbpel. I did not take the time to figure out how to get the wsbpel dded to the list. So I edited

                     

                    Part of step 4 required that you edit the BPEL file via text - the "Initialize Role" check box, which you need to check, is greyed out. Nothing I did resulted in that check box being enabled. Even with editing the file by hand, the box remained greyed out and unchecked.

                     

                    In step 2 I obtained the WSDL by going to http://localhost:8080/jbossws, following the link to the page of WSDLs, clicking on the WSDL link, and then asking the browser to save the result in a file. The file was missing the xml version line:

                    <?xml version="1.0" encoding="utf-8" ?>

                    Without this line, I got a "missing content-type" error when I deployed the BPEL.

                     

                    Feng, now you know why I stated that your steps were too simplistic. And I will go even further than that - my steps, while complete, leave out a lot of details and it is some of those details that will mess you up. The GUI provides no help whatsoever with filling in the details - it pretty much expects that you already know what information is important and what is not. I suspect that anyone very familiar with BPEL will avoid the GUI and edit the text by hand. But anyone who is not intimately familiar with BPEL will soundly curse the GUI for not providing any clue as to how to appoach common tasks, such as invoking an external web service.

                    • 7. Re: Tutorial for BPEL simple-invoke
                      peterj

                      I HATE THIS EDITOR!!!!!!!!

                       

                      The stupid editor has screwed up and is starting to place characters in the wrong location despite where I place the cursor.

                       

                      Anyway, on my comments on step 3, the last senetnce. which the $%^%$#@ editor will not let me finish, should read:

                      So I edited the xmlns entry in the external web service WSDL by hand to reference the wsbpel URL.

                      • 8. Re: Tutorial for BPEL simple-invoke
                        grid.qian

                        Hi Max,

                         

                        The riftsaw samples are not eclipse project. It has a folder and use ant to deploy them into runtime.

                         

                        ------ What does "dynamic project" mean ? Ear, War, BPEL ?

                        The war that is in riftsaw samples is a folder, we can't deploy it into server directly. So we need create

                        a dynamic web project, then copy these files into it, then deploy it into server as a war.

                         

                        ------ What does "correctly location" mean ?

                        The corretly location means we need copy the codes into src, the web.xml into WebContent/web-inf, and

                        so on.

                         

                        ------ And why do we suggest manually copying WAR files into these when WTP has  support for including war's into project s?

                        You means we can include a war into bpel project and deploy it into server? The bpel project is not a web or j2ee project.

                        Has WTP support do like this in bpel project?

                        • 9. Re: Tutorial for BPEL simple-invoke
                          grid.qian

                          Thanks a lot for your input, Peter!

                          At first, what I want to say, yes, the editor is not good enough. We need to do more works for it to improve it's usability.

                          And then, what I want to say, the bpel editors that I used, such as IBM's, Active BPEL's, Oracle‘s and so on aren't all

                          ease to use. The bpel is a difficult file to read and write whatever GUI or text.

                          We will go on improving the editor, wish it can be easier to use after a while. I will work over your comment and fix

                          some bugs or improve it.

                          Some questions of your comments are actually from WTP WSDL editor. For example, we can't add a partnerlink type

                          by GUI. I have create a extension for this WSDL editor, but because need some changes from WTP team, so I can't

                          add the extension to the current jboss tools.

                          BTW, if you can create some jiras for your problems, it will be great!

                           

                          Thanks

                          Grid

                          • 10. Re: Tutorial for BPEL simple-invoke
                            maxandersen

                            Grid.Qian wrote:

                             

                            Hi Max,

                             

                            The riftsaw samples are not eclipse project. It has a folder and use ant to deploy them into runtime.

                            Which we should help fix so they become usable in other setups

                             

                            ------ What does "dynamic project" mean ? Ear, War, BPEL ?

                            The war that is in riftsaw samples is a folder, we can't deploy it into server directly. So we need create

                            a dynamic web project, then copy these files into it, then deploy it into server as a war.

                            ok, sure so write that

                            ------ What does "correctly location" mean ?

                            The corretly location means we need copy the codes into src, the web.xml into WebContent/web-inf, and

                            so on.

                            Yes, so write that. Users are not mindreaders

                             

                            ------ And why do we suggest manually copying WAR files into these when WTP has  support for including war's into project s?

                            You means we can include a war into bpel project and deploy it into server? The bpel project is not a web or j2ee project.

                            Has WTP support do like this in bpel project?

                            well I dont think a bpel deployment contains a war anyway, but a bpel project is a dynamic project, right ? those are possible to include in the module assembly page - at least they should be possible to do.

                             

                            Ask Rob - thats what the whole reason for having the bpel project be a real WTP project so it could be referenced from war, ear's etc.

                            • 11. Re: Tutorial for BPEL simple-invoke
                              peterj

                              I agree that BPEL is not very intuitive, but that is no reason why the editor cannot be.

                               

                              For example, let's say we start with a new BPEL project. Then...

                               

                              When the user creates the a new BPEL process file, why does the use have to edit the generated WSDL to add in the Service and the Binding? Instead, have the new BPEL Process File wizard ask the user what inputs and outputs they would like for the process and generate the complete WSDL accordingly.

                               

                              When the user wants to add an Invoke to the workflow, after dragging the Invoke action to the workflow, the Assign Wizard should aks the user to identify the WSDL, and allow the user to indicate which variables contain the parameter information and will receive the return result. The tool will then a) copy the WSDL into the project, b) add a pertnerLinkType to the WSDL, c) add a pertnerLink to the BPEL, d) add the edditional variables to the BPEL, e) add the Assign actions needed to copy the data among the variables.

                               

                              Doing similar wizards for the other actions or controls wouldprobably satisfy 80-90% if a user's requriements for defining a BPEL. And it would make doing that 80=90% fairly easy and intuitive. Then only users who need mopre advanced capabilities would need to understand BPEL in depth.

                              • 12. Re: Tutorial for BPEL simple-invoke
                                peterj

                                I recently realized that I misread Feng's first response to my original question, specifically step 2. I thought that Feng was suggesting to add an Invoke action to the BPEL. Which is why I stated that Feng's steps were too simplistic - it takes a lot more that just adding an Invoke action.

                                 

                                But Feng was actually suggesting that I import the simple-invoke project into Eclipse and open it. Considering that I wanted a tutorial on how to RECREATE the simple-invoke project, I do not see how step 2 would do that.

                                 

                                This is one of the things that bugs me about a lot of the open source tutorials that I see. Many of them consist of the steps: "run this ant script and open the browser to this URL. Congratulations, you are now running XXX!" Oh really? And how does this impart knowledge of working with the technology to me? Without an understanding of how to build the app from scratch, I am pretty much left in the dark as to how to tackle a new project using that technology.

                                 

                                And the sad thing is that I know the person who developed that technology knows how to use it to to do wonderful things, but unless that knowledge is somehow communicated to us "unwashed masses", the technology will be either ignored or misused.  (I have a working BPEL, but is it really correct or will I have issues later on I attempt to expand on it? I have no idea, because no one told me how the tool is supposed to be used. So I experimented with it and possibly used it the wrong way.) I have had this point pounded into my head by some very patient technical writers who over time helped me realize that without adequate documentation that is written in the user's language (i.e., not in technical jargon) and tells the user how to use the technology to solve his or her problem (i.e., does not just describe how wonderfully the code was architected), that my wonderfully written code that I was so proud of is pretty much useless.

                                 

                                The current tutorial is a good start. But considering that BPEL is a means for orchestrating web services, the tutorial is woefully inadequate. The minimum tutorial should show how to use the tool to invoke an external web service (i.e., build simple-invoke from scratch). That way the user will know how to use the tool to incorporate web service calls into his or her BPEL.

                                 

                                I apoligize if my tirade has offended, I guess my frustration level is really high right now. Is it happy hour yet? I need a beer!

                                • 13. Re: Tutorial for BPEL simple-invoke
                                  dennyxu
                                  BPEL project is a  bpel project is a dynamic project, but current BPEL deployment doesn't  support to contains any sub-module, if we want to do so, just need to change the BPEL module factory.
                                  • 14. Re: Tutorial for BPEL simple-invoke
                                    grid.qian

                                    Thank you very much, Peter!

                                    Any suggestions or ideas, include criticism, would be greatly appreciated.

                                    This editor is very rough and not easy to use. Up to now, what we do just make it can work without important bugs or breaks.

                                    But the usability of the tools is more important and need we to give more effort.

                                    I will study your suggestions and chat with my team member for how to improve these shortages.

                                     

                                    Thanks again.

                                     

                                    Grid

                                    1 2 Previous Next