IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only

Calling a rest service in javascript in CAF

  • 1.  Calling a rest service in javascript in CAF

    Posted 01/12/19 05:47 AM

    Hi,
    I explained : I have a portel (I will call for example portletTown). This is load in intialization Action by a soapService in the bindingView via the method getTown.

    OK,
    In this portlet, I have a field named Family wich is a dropdownList. We can choose the family among a familyList via the method getFamilies called in the initializationAction.

    Until now I can do it.
    Now each item of my dropdownlist are hypertext link. When I clicked on it, it openned a dialog box.

    This I Can dot it thanks to the sample Code available in GithUb via the Trip Ticks & Code on this site. (It is called MFT_Controls project).

    My dialog box open another Portel (portletFamily). This I can do it via the importTemplateView.

    But this portlet show the following field :
    FamilyName
    FamilyColor
    FamilyDictum.
    FaimyEmblem
    This can be filled by the method GetFamily

    But the difficulties is : it is when I clicked on the hypertext that open the dialogbox with the data of the item in combobox.

    So for the getFamily methode, I choose a REST service in IS instead of SOAP (In Javascript it is easier to handle Json value thant a soap Enveloppe I guess).

    I find a code (in this site), for AngularJS to provide a REST service : this url :
    [url]http://techcommunity.softwareag.com/ecosystem/communities/public/webmethods/products/bpm_suite/codesamples/20150424133633378/[/url]

    The only things is I dont know how to call the RestServiceProvider function : give the url, parameter or get the result.

    For instance in the portletTown,

    • in the initialization action I called the action getTown as web service descriptor. I put the parameter getTown.getParameter.getFamilyTownName = “WINTERFELL”.
    • in the initialization action I called the methode getFamilies and that give as result
      • Stark
      • Lannister
      • Targaryen
    • In the drop down list of family in portletTown the value is Stark but the item list are filled with the resultat of getFamilies method.
    • Each item of the drop down list are hypertext.
    • As user I clicked on the Stark link.
    • That open the dialogbox with the portletFamily.
    • What I dont know how to process : I called a javascript (RestServiceProvider ?) who called the getFamily REST service with the following parameter as familyName : Stark.
    • Each field of my web service are filled with the result of getFamily method
      • Field FamilyName = “Stark”
      • Field FamilyColor = “Grey”
      • Field FamilyDictum = “Winter is coming”
      • Field FamilyEmblem = “a wolf”

    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS