Service Consumer Builder

 

In this topic ...

How Do I...

Specifying Inputs

Objects this Builder Creates

Related Topics ...

How to Use the Service Provider Builder

This Builder works in conjunction with the Service Provider Builder, and is used to provide access to services exposed by the Service Provider Builder. This Builder interrogates a specified Service Provider model and generates the code required to invoke the exposed method(s) in that model.

This Builder generates the code required to support the following two operating modes:

  • Add Single Method In this mode we can select an individual method that was made available in a service provider target model. To invoke the service from your consumer model you use the execute<buildername> or execute<buildername>WithArgs generated method.

  • Add All Methods In this mode you make available all the exposed methods in the Service Provider target model. We can call any of these exposed methods from the consumer model. To invoke the service from your consumer model you will use the execute<target method name> or execute<target method name>WithArgs generated method.

 

How Do I...

Expose a method and use it in a Service Consumer?

Create a model that provides functionality that you want to expose as a service. An example might be a method that returns a list of records from a backend database, such as SAP or PeopleSoft. The model should provide a method ( that may or may not take arguments) that returns the desired data. The returned data can be directly returned from the method, or placed in a known schema typed variable.

Add a Service Provider Builder to your model and select the appropriate method to expose. Save and close the Service Provider model.

Next create or open an existing model that you want to have consume the provided service. In this consumer model add a Service Consumer Builder and select the provider model and method.

The Service Consumer Builder will add a local method to your model that can be used to invoke the service. The service inputs and outputs will be exposed a Variables.

Finally, add Builders to your model to invoke the service method and process the output.

 

Specifying Inputs

The Service Consumer Builder takes the inputs described in the table below. For help on inputs common to many or all Builders such as those in the Properties input group, see "Using the Builder Call Editor."

Input Name Description
Name Enter a name for this Builder call. The Designer displays this name in the Builder Call List.

This entry is used as the local name of service. If this input is blank or if "Add All Target Methods" is enabled, the target method name will be used.

Target Model Select a target model that contains a Service Provider Builder you want to use.
Profile Name Specify an optional profile name to apply to the target model selected above.
Add all Target Methods Enable this input to force the Builder to add methods and utility argument/response variables for all services in the target model.

Disable to use a single method specified in Method Signature below.

Refresh Methods Press this button to force the Builder to refresh its list of target model methods.

You might need to do this if you make changes to the target model.

Method Signature This input is available when "Add All Target Methods" is disabled.

Select a method from the target model.

 

Objects Created by the this Builder

A variety of WebApp artifacts are created by this Builder. These artifacts include the following LJOs, variables, methods and Data Services:

 

Linked Java Objects

  • <buildername> - LJO that includes helper methods that are used by the generated method to invoke the service.

 

Variables

  • <buildername>_inputs or <target method name>_inputs - Schema-type input variable used by the execute<buildername> or execute<target method name> method.

  • <buildername>_inputs_<argument name> or <target method name>_inputs_<argument name> - Individual variable passed to the target service method. Used by the execute<buildername> or execute<target method name> method.

  • <buildername>_reply or <target method name>_reply - Reply variable used by the execute<buildername> method.

 

Methods

  • <buildername>_createHelper - Method used to initialize the LJO helper class.

  • execute<buildername> or execute<target method name> - Method used to invoke the service without passing arguments.

    Note that The <buildername>_inputs or <target method name>_inputs WebApp Variable should be populated prior to invoking this method.

  • execute<buildername>WithArgs or execute<target method name>WithArgs - Method used to invoke the service, passing any required arguments.

 

Data Services

  • <buildername> - Data Service metadata that provides the name of the operation provided by this Builder, and the input/output Variables used by each operation. Relevant property information is also provided.