The Invoke Service action calls a specified service, typically another Morphyc agent (node), and updates the Factbase with the response XML.
The Service field should contain the full ID of the Morphyc agent (node) to call, and the Action field should specify the action to call on that agent (node).
The Service Call Helper option can be used to easily find the required node ID. This should open a new window, providing drop down lists of all the available patterns and agents (nodes) to select from. When you have selected the required entry, simply click the OK button to populate the values into the action.
Even if you wish to call an external web service, you should create a Morphyc agent (node) to represent the service (or use the WSDL import feature found by clicking the Import WSDL link on the main XDE Project screen). You can then specify an Invoke Service rule to call that agent (node). At deploy time you can define the new agent (node) as a web service proxy and enter the appropriate location information of the remote service. In this way you avoid needing to enter external location information within your application logic.
The Invoke Service action has two parameters. The first (from location) indicates the xml node to send as the request to the service, and the second parameter (to location) indicates the location in the FactBase to insert the response. Both of these require XPaths.
The Invoke Service action also takes a property called the Merge Option. This property can either be set to append or replace. Replace will replace the contents of the to location with the returned xml. Append will add the returned XML as a child of the existing data, and is the default value.
Parallel Processing
The Invoke Service action also has the ability to perform a non-blocking service call. This starts the service call on a different thread, enabling other rules to continue execution. If your response from this Controller depends on the outcome of the non-blocking service call then you should check for the response in another rule and act accordingly. For example, if you need to check for a specific response document fragment or specific field values from the non-blocking call then you should check for this in the FactBase using the condition of another rule. This will ensure that the non-blocking call has completed and returned the desired outcome before returning. You can also check for the outcome of multiple parallel calls to other services, by incrementing a count field within the FactBase as each service completes and returns. You can use any valid XPath expression to determine the outcome of non-blocking service calls.
This feature should enable you to achieve better performance and can be activated by clicking the Run this Action in Parallel? tick box.