The Corticon.js V2.0 release introduces a new feature called Service Call Out.
Here is a simple ruleflow example where the SCO Call is executing after a specific rulesheet (“Before SCO Call”):
Note: The service call out can happen anywhere in the ruleflow. It could be the first or last step of the entire ruleflow.
We provide an API to facilitate reading from the payload as well as writing to it. This can be leveraged to enrich the payload with additional data. It is useful for use cases where it is not desirable to pass the data in the input payload in the first place, i.e. when services will only use some of the data in specific execution paths.
Another way to put this is that some services will need to conditionally access additional data based on conditions computed in the decision service. For example, when computing an offer for a solar system installation, you will need access to various configuration pricing data. Instead of passing all the data for all possible configurations for all the regions, it may be more appropriate to have an SCO request the subset of the data the decision service really needs at that point in the execution.
Of course, the SCO can persist portion of the payload to an external data source.
Example usages could be to access data via a REST service or a Database call. Or, it could be to provide some complex financial calculation.
For more information on the API, check the online documentation here.
To get started, we have provided several samples at https://github.com/corticon/corticon.js-samples/tree/master/ServiceCallOut.
Here is a brief run down of the first ones you need to focus on to get started smoothly:
HelloWorld is the simplest SCO. It is at https://github.com/corticon/corticon.js-samples/tree/master/ServiceCallOut/HelloWorld.
It shows the basic mechanics of an SCO.
Next, you should look at the basic sample to update attributes https://github.com/corticon/corticon.js-samples/tree/master/ServiceCallOut/UpdateEntityAttributes.
If your use case requires creating additional entities and relations (for example adding child entities to a parent entity), check this sample: https://github.com/corticon/corticon.js-samples/tree/master/ServiceCallOut/CreateAssociation.
When you need to pass configurable data, you can leverage the access to the configuration properties as illustrated in this sample: https://github.com/corticon/corticon.js-samples/tree/master/ServiceCallOut/AccessConfigurationProperties.
Most likely you will need to access (read or write) data from external data sources. In this case, you will need to understand how to do asynchronous operations. We will cover considerations for doing asynchronous operations in a separate blog but in the meantime, check this sample to get started: https://github.com/corticon/corticon.js-samples/tree/master/ServiceCallOut/BasicAsyncOperation.
There are several additional samples not described here. Check them out at: https://github.com/corticon/corticon.js-samples/tree/master/ServiceCallOut.
The support for either passing all the data in or conditionally accessing data on an as-needed basis at any point in the flow provides maximum flexibility in architecting and designing optimum decision services.
Writing to a data source at any point in the decision service flow also provides architecture flexibility.
Find out here how Corticon as a no-code/low-code environment can help increase your productivity and deliver your solutions faster.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.Learn More
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.