JavaScript Cast Iron Adapter

improve this page | report issue

Overview

IBM WebSphere Cast Iron enables companies to integrate applications, whether the applications are located on-premises or in public or private clouds.
WebSphere Cast Iron provides an approach to integrating applications that does not require any programming knowledge.
You can build integration flows in WebSphere Cast Iron Studio, which is a graphical development environment that is installed on a personal computer.
With Cast Iron Studio, you create an integration project that contains one or more orchestrations. Each orchestration is built with a number of activities that define the flow of data.
IBM MobileFirst Platform Foundation provides a Cast Iron Adapter type to integrate with WebSphere Cast Iron.

A MobileFirst Cast Iron adapter initiates orchestrations in Cast Iron to retrieve and return data to mobile clients.

missing_alt

For more information about Cast Iron, see:
http://www.redbooks.ibm.com/redpapers/pdfs/redp4840.pdf
http://www.redbooks.ibm.com/abstracts/sg248004.html?Open

Creating the adapter

CLI

From the project's directory, use mfp add adapter and follow the interactive instructions.

Studio

missing_alt

missing_alt
In MobileFirst Studio, create an adapter and select the Cast Iron Adapter type.
A standard Cast Iron adapter file structure is created.

Procedure Implementation

Procedures are implemented in the adapter JavaScript™ file.
Procedure names in the JavaScript file must be the same as in the XML file.
The mandatory invocation parameters are method, appName, requestType, path, and returnedContentType.
The transformation parameter is optional and takes the type and xslfile subparameters.
Procedures can be parameterized at run time.

function startOrchestration(orchestrationName) {
  var input = {
    method: 'get',
    appName: 'myApp',
    requestType: 'http',
    path: orchestrationName,
    returnedContentType: 'xml',
    transformation: {
      type: 'xslFile',
      xslFile: 'ci-filtered.xsl'
    }
  };
  return WL.Server.invokeCastIron(input);
}

To invoke a Cast Iron request, use the WL.Server.invokeCastIron API method.
Provide an input parameters object with the following properties:

  • method: the HTTP method (get or post)
  • appName: the application name
  • requestType: the request type
  • path: the service path
  • returnedContentType: the returned content type (XML, JSON, HTML, or plain)
  • transformation (optional): applies transformation filters to the received data

For a complete list of invocation options, see the MobileFirst user documentation about adapter files.

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on November 09, 2016