Automated decision service deployment sample details
You can run and rebuild this sample, and you can also look at source files to understand how this sample works.
Running the sample
-
In the Samples Commands view, navigate to .
Tip:To open the Samples Commands view, you can click the View sample commands link in the Samples and Tutorials view.
-
Run the deploy.ant.both or deploy.ant.file command to deploy a decision service by using the Decision Center Ant task deploy. It cleans the test output directory and uses the deployment configuration "production deployment" to deploy either on both the sample Rule Execution Server and in the test directory, or just in the test directory.
When deployment is complete:- Check that the RuleApp production_deployment is available in Rule Execution Server: http://localhost:<PORT>/res (resAdmin / resAdmin). It contains the loan_validation_production ruleset.
- Check that the RuleApp file is available in <InstallDir>/teamserver/samples/dsdeploy/test/production_deployment.jar.
-
Run the deploy.API.both or deploy.API.file command to deploy a decision service by using the Decision Center API. It uses the deployment configuration "test deployment" to deploy both to either the sample Rule Execution Server and the test directory, or just the test directory.
When deployment is complete, check that the RuleApp test_deployment is available in Rule Execution Server. It contains two rulesets: loan_validation_production and loan_validation_with_score_and_grade. Check that the RuleApp file is available in <InstallDir>/teamserver/samples/dsdeploy/test/test_deployment.jar.
Rebuilding the sample
- In the Samples Commands view, navigate to .
- In the Sample Server view, click Restore the sample server to return the sample server to its initial state.
How this sample works
Look at the decision service. Log in to the Business console by using Paul as the user and password.
Explore the Spring Release branch of the Loan Validation Service decision service. In the Deployments tab, you can see that there are two deployment configurations defined. Have a look at the deployment configuration to check the operations.
The deploy.ant.file and deploy.ant.both task uses the Decision Center Ant task deploy. It gives the appropriate arguments to deploy the decision service by using the production deployment configuration.
- It decodes the arguments
- It initializes the session to connect to Decision Center (see the Connection class)
- It deploys the decision service by using the IlrDeploymentFacility:deployDSRuleAppArchive function. It gets the server instance from its name in the Decision Center database
- It closes the connection to Decision Center
Source files
This sample is in <InstallDir>/teamserver/samples/dsdeploy.
You can view and modify the sample source files in Rule Designer. To import the sample into your workspace, click the Import projects link in the Samples and Tutorials view, and switch to the Java™ perspective.