skip to main content
Guide to Creating Corticon Extensions : 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. In the Project Explorer, click on myProject, and then select Properties. Select Corticon Extensions. Click Add then navigate to each of the sample Rule Projects to select its extensions JAR, as shown:
While it is good to copy extension JARs you want to use into your project, you can navigate to other locations to add them to your project
8. Because the JARs were referenced in their original locations, they are not listed in myProject folder. If your extensions requires other JARs, you can add them here.
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.