Canvas facilitates the purpose of using additional readymade activities, supported by Request Modeler. For more information on the activities, supported by Request Modeler and their associated instruction classes, refer Activities. For the full set of information on stateModelLibrary.json, refer Library JSON.
Connecting to a Web Service using existing data source Id
The activity of connectToWS facilitates the purpose of using the existing data source Id to connect to the web service. The following code snippet is a sample reference to use this activity in stateModelLibrary.json:
Code Block |
---|
{ "id": "W01", "type": "connectToWS", "datasourceId": "WS_DS" //existing data source Id } |
...
The activity of updateDB paves the way for updating the request data by specifying the model/request Id and the relevant fields that require appropriate updates. The following code snippet is a sample reference to use this activity in stateModelLibrary.json:
Tip |
---|
The fieldValue can be applied from the context value or you can even use the default or static value. |
...
Code Block |
---|
{ "id": "DB01", "type": "updateDB", "modelId":"CARD_REQ", //optional "fieldList": [ { "fieldName": "CARD_TYPE", "fieldValue": "$response.serviceResp.status", "defaultValue":"Debit" }, { "fieldName": "CARD_NO", "fieldValue": "$context.OLD_CARD_NO" } ] } |
...
Note |
---|
The model ID can be passed from the client side. If the model ID is passed through JSON and the client side, then the JSON will get the top priority. It is feasible if you pass the model ID either as a JSON parameter or from the client side. |
...
- While creating a request in Canvas Studio, specify "POST_PUBLISH" : "Y" in Additional Params field, so as to proceed with post publish activities. For the relevant information on creating request in Canvas Studio, refer Configuring Request Modeler and and Creating Library Request. The following code snippet is a sample reference on adding the post publish activities, involving the action of Submit in stateModelLibrary.json:
...