skip to main content
Corticon Extensions Guide : Using extensions when creating Decision Services
 

Try Corticon Now

Using extensions when creating Decision Services

You might want your project to include extensions that are already packaged and ready to use. The sample extensions bundled with Corticon Studio provide sample Rule projects with their samples already packaged into JARs.
For now, assume that you just want to use the functionality in these extensions.
To use the packaged extension samples in my project:
1. In Corticon Studio, choose Help > Samples. Locate the Advanced samples:
2. Select Extended Operators, click Open, and then click OK.
3. Then do the same to open the Service Callouts sample.
4. Your Studio's Project Explorer lists the two samples, each with its Java project and its Rules project:
5. Expanding the two Rule Projects, you can see that each has a related samples JAR.
6. Create a new Rule Project named myProject and create a very simple Vocabulary that includes a date type:
7. Copy the JAR files highlighted in step 5, and then paste them in to myProject.
Note: While you could reference the JARs in their projects, copying them into your project insures that when you export that Project, those JARs are included so the references don’t break.
8. In the Project Explorer, click on myProject, and then select Properties. Select Corticon Extensions. Click Add then navigate to each of those JARs, as shown:
Note: This feature does not support JARs nested within a JAR that you add to a project.
9. Create a Rulesheet in myProject. Note that the Rule Operators tab adds in the extended operators that are in the JAR, so that you can readily use one as a valid operator in the Rulesheet, as shown:
10. Create a Ruleflow in myProject. Click Service Call-out on the palette, click on the canvas, and then name it. On the Properties tab, click the Service Name dropdown to see the service callouts that are packaged in the sample JAR you added to the project, as shown when getPatientInfo was selected:
Because the two extension JARs are properties of the project, they are embedded in Decision Services that you package and deploy from Studio.
The next section looks at the source code in each of their Java projects to gain insight into how extensions are created and prepared for use.