Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| 2500_config_apps:0500_add_edit_objects:0600_intelligent_bo [2026/08/13 03:33] – localdev | 2500_config_apps:0500_add_edit_objects:0600_intelligent_bo [2026/08/13 03:38] (current) – localdev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{tag> | + | {{tag> |
| [< | [< | ||
| ====== Defining Intelligent Business Objects ====== | ====== Defining Intelligent Business Objects ====== | ||
| Line 36: | Line 36: | ||
| <callout type=" | <callout type=" | ||
| + | |||
| + | ===== Setting Properties of the URL Channel ===== | ||
| + | |||
| + | Communication with an intelligent business object via the URL channel assumes that // | ||
| + | |||
| + | If services exposed by the business object require input (see [[2500_config_apps: | ||
| + | |||
| + | < | ||
| + | |||
| + | where '' | ||
| + | |||
| + | The following properties should be specified: | ||
| + | |||
| + | ==== URL of the service provider ==== | ||
| + | |||
| + | This is the URL where the requests will be sent. This property is mandatory. | ||
| + | |||
| + | ==== Request parameter identifying the URL to return to if success ==== | ||
| + | |||
| + | The service provider represented by the intelligent business object may expect that the request contain the URL that the provider should return to in case of the successful fulfilment of the service. // | ||
| + | |||
| + | < | ||
| + | |||
| + | where '' | ||
| + | |||
| + | ==== Request parameter identifying the URL to return to if a failure occurs ==== | ||
| + | |||
| + | |||
| + | This is the same as the previous parameter except that the return URL indicates failure rather than success. If this parameter is not specified // | ||
| + | |||
| + | ===== Setting Properties of the REST Channel ===== | ||
| + | |||
| + | Communication through the REST channel involves sending an HTTP call to a particular URL. Unlike the URL channel no user interface is involved in the call – the service returns straight away and the execution of the rules continues. Services exposed by an intelligent object through the REST channel can be discovered if the provider supplies a file in an Open API format describing exposed services. They can also be added manually as described below. | ||
| + | |||
| + | To discover services automatically click on the “Discover” button above the services table. Then provide the URL of the file in the Open API format (with .json or .yaml extension). AwareIM will automatically discover services exposed by the provider and will display them. You can then select the services you will be using in your application. | ||
| + | |||
| + | To add a service manually, click on the “Add” button above the services table. To edit the service details click on the “Edit” button and to delete a service click on the Delete button. You can also copy a service that you have already defined to use it as a basis for another service. To do this select a service, click on the “Copy” button, then click on the “Paste” button to create a duplicate of the service and then click on the “Edit” button to modify it. | ||
| + | |||
| + | The following properties can be specified when adding/ | ||
| + | |||
| + | ==== Name ==== | ||
| + | |||
| + | Specify the name of the service. The name must be unique among other services of the business object. The name must start with a character or underscore symbol and contain characters, digits or underscore symbols. Spaces are not allowed in the name. | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | The optional description of the service: what it does, how it is used etc. | ||
| + | |||
| + | ==== Base URL ==== | ||
| + | |||
| + | The URL to call when the service is requested. This URL should not include any URL parameters. You can use tag expressions to refer to attributes of the objects in Context here. | ||
| + | |||
| + | ==== HTTP Verb ==== | ||
| + | |||
| + | HTTP verb to use when the service is called – usually '' | ||
| + | |||
| + | ==== Parameters ==== | ||
| + | |||
| + | Parameters of the service can be specified in different ways depending on what the provider requires. | ||
| + | |||
| + | ==== URL-encoded string ==== | ||
| + | |||
| + | |||
| + | If a provider requires that parameters must be specified in the URL of the call, specify them here. You can use tag expressions to refer to attributes of the objects in Context. | ||
| + | |||
| + | ==== Request Body ==== | ||
| + | |||
| + | |||
| + | Use these values if parameters need to be encoded into the body of the request. You can define further details if you click on the Details link to bring up the Request Body dialog. | ||
| + | |||
| + | A body of the request may consist of several “parts” if parameters include binary content. Usually, though, the request contains just one part. To specify the content of the part you can do either the following: | ||
| + | - Provide the text string containing all parameters (you can use tag expressions inside the string ) | ||
| + | - Refer to an attribute of some object in Context. | ||
| + | - Refer to the entire object in Context. | ||
| + | |||
| + | To specify parameters as a string you should select “text/ | ||
| + | |||
| + | The value of the parameter may also be stored in an attribute of some object in Context in which case you should select the “Take From Context” radio button and then select the name of the object and attribute that holds the parameter. You also need to specify the correct Content Type of the value stored in the attribute. | ||
| + | |||
| + | If you select the “Take From Context” radio button, specify the object, but do not specify the attribute, // | ||
| + | |||
| + | If your service provider requires that you provide binary content as a parameter along with some primitive values (for example, text or number) you should specify each parameter in its own part. For example, if you need to provide a binary value and a number, you should define two parts – the first part (binary) should have “application/ | ||
| + | |||
| + | <callout type=" | ||
| + | |||
| + | <callout type=" | ||
| + | |||
| + | <callout type=" | ||
| + | |||
| + | To add a part, click on the “Add” button above the list of the defined parts. | ||
| + | |||
| + | ==== HTTP Headers ==== | ||
| + | |||
| + | |||
| + | Click on the “HTTP Headers” link to define one or more optional HTTP headers that will be added to the HTTP request if the provider requires them. For each header provide its name and value. Note that the value may refer to the current Context of the process when the service is called. To do this, enclose the value in “tags” (double angular brackets), for example: <code aim><< | ||
| + | |||
| + | ==== Reply ==== | ||
| + | |||
| + | If the REST call returns a reply that you need to handle in your application, | ||
| + | |||
| + | - For text replies all you can do is write the string with the reply into some attribute of an existing object in Context of the process where the service is called. You need to specify the name of the object and the attribute where the reply will be stored. You will then need to add further rules to analyse the provided reply and perform further actions | ||
| + | - For JSON and XML replies you can get // | ||
| + | |||
| + | ==== OAuth Support ==== | ||
| + | |||
| + | Many vendors providing REST services support OAuth protocol that mandates that the caller of the service authenticates himself using a special protocol before a call to the service is made. If this is the case you need to tick the “OAuth Supported” checkbox underneath the services table and then click on the “Details” button to provide further details: | ||
| + | |||
| + | ==== Provider ==== | ||
| + | |||
| + | // | ||
| + | |||
| + | You can also add your own providers to the list if you know their values. To do this modify the file '' | ||
| + | |||
| + | ==== OAuth version ==== | ||
| + | |||
| + | Different vendors support different versions of the OAuth protocol. The settings are quite different depending on which version is supported. Choose either version 1.0 or 2.0 | ||
| + | |||
| + | ==== API Key, API Secret ==== | ||
| + | |||
| + | The caller of the service must be registered with the vendor to make OAuth-based REST calls. The vendor issues API Key and API secret to the caller. These need to be specified here. If these values are stored in the attributes of some object (for example, '' | ||
| + | |||
| + | Also when registering your application with a provider, make sure that you include the following URI as " | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | ==== Scope ==== | ||
| + | |||
| + | Some vendors require that you specify the “scope” of the service request. This is vendor-specifc – refer to the documentation of the vendor. | ||
| + | |||
| + | ==== Signature type ==== | ||
| + | |||
| + | |||
| + | This value is only for OAuth 1.0. Refer to the documentation of the vendor as to which signature type you need to provide | ||
| + | |||
| + | ==== Request for request token ==== | ||
| + | |||
| + | The values in this section are only for OAuth 1.0 that requires that the system first sends a request for a " | ||
| + | |||
| + | ==== Request for access token ==== | ||
| + | |||
| + | A call to the service using OAuth can only be done if the vendor issues an " | ||
| + | |||
| + | ==== Token expiry ==== | ||
| + | |||
| + | Access tokens may expire. If a call to the service is made with an expired token an error message will be returned. The error message is specific to the vendor. If you help // | ||
| + | |||
| + | ==== Log ==== | ||
| + | If you tick the Save button AwareIM will capture all communication in a log. It will record the name of the service called, time of the communication, | ||
| + | It will also record HTTP headers of the request and response. The log will be captured in the instance of the object that you specify (you also need to define the attributes in this object that will store the log, as well as the attribute storing the name of the service and timestamp (the latter two attributes are required, so that you can sort by time and service. | ||
| {{simplenavi> | {{simplenavi> | ||