To deploy a decision service to a target Decision Server, you download the
corresponding RuleApp and its XOM from the source cloud environment, and use the REST API to place
the RuleApp and XOM binary files on the target Decision Server. Then, you can run the
decision service on this Decision Server.
Before you begin
You must have access to your cloud environment and deployed the decision service.
About this task
The example commands that are provided in the following procedure use cURL to
authenticate with the cloud server and transfer archive files from the cloud server to another
Decision Server. You can use a different program
to send authentication credentials to the servers, access the REST API, and download files from the
cloud server.
Procedure
-
Download the RuleApp from the cloud environment.
The command includes basic authentication credentials and the path to the RuleApp. Replace the
user name and password variables with your basic authentication credentials. Provide the host URL of
your cloud tenant, and specify the correct name of the RuleApp in the path:
curl -k -u username@company_name.com:password server_URL/odm/cloud_env/res/api/v1/ruleapps/ruleapp_name/1.0/archive --output ruleapp_name.jar
-
Download the XOM:
-
In the ruleset.managedxom.uris property in the output of the previous
command, look for the managed XOM URI. This property gets the RuleApp details.
-
If the property points to a XOM resource (resuri), skip this step. If it
points to a library (reslib), check the content property in
the output of the previous command for the XOM URI. The content property gets the
library details. Use the name and version of the library that is returned in the previous
command.
curl -k -u username@company_name.com:password server_URL/odm/cloud_env/res/api/libraries/library_name/1.0
-
Download the XOM. Use the name and version of the resource returned in the previous
command.
curl -k -u username@company_name.com:password server_URL/odm/cloud_env/res/api/xoms/xom_name/1.0/bytecode --output xom_name.zip
-
Upload the XOM.
curl -X POST -k -u admin_username:admin_password server_URL/res/api/v1/xoms/xom_name.zip --data-binary @xom_name.zip -H "Content-Type:application/octet-stream"
If the RuleApp references a library rather than a XOM, re-create the library and specify the
XOM resource that it is supposed to
contain.
curl -X POST -k -u admin_username:admin_password server_URL/res/api/v1/libraries/library_name1.0 -d "resuri://xom_name.zip/1.0" -H "Content-Type:text/plain"
Note: Keep the names of the resources when downloading and uploading them.
-
Upload the RuleApp to the other Decision Server.
The command includes the user name, password, and URL to access the Rule Execution Server console on the other Decision Server.
curl -X POST -k -u admin_username:admin_password server_URL/res/api/v1/ruleapps --data-binary @ruleapp_name.jar -H "Content-Type:application/octet-stream"
-
Test the execution of the ruleset (decision service) by using its REST API.
curl -X POST -k -u username@company_name.com:password server_URL/DecisionService/rest/v1/ruleappname/ruleappversion/rulesetname/rulesetversion -d jsonpayload -H "Content-Type:application/json"