Project Design Tutorial : Add a Cluster Deployment Descriptor and Build the EAR File

Add a Cluster Deployment Descriptor and Build the EAR File
To deploy a project you need a CDD file and an EAR file. The CDD is not included in the project EAR. This means you can reconfigure a project’s deployment configuration without having to rebuild the EAR.
Learning Points
What is an EAR  The Enterprise Archive or EAR file contains details for all the resources in a project, and project global variables.
What is a CDD  The project’s deployment configuration is defined in an XML file called the Cluster Deployment Descriptor, or CDD. You edit this file using the TIBCO BusinessEvents Studio Cluster Deployment Descriptor editor.
How do I set up preprocessors and startup and shutdown rule functions?  The CDD is where you configure rule functions to act as event preprocessors, startup rule functions, or shutdown rule functions! Only rule functions whose Validity setting is Action are valid for these uses. Such rule functions cannot require anything to be in their scope, because they execute outside of the context of the Rete network and BusinessEvents project resources.
What is an object management type?  Object management refers to how BusinessEvents manages the objects generated within the BusinessEvents application at runtime. For some applications, the objects are more important than for others. This tutorial focuses on the basics, so it uses In Memory, the simplest OM type. Objects are kept in memory only, and are lost when the engine stops.
What is an inference agent?  An agent does certain work within the engine. With Cache OM, different types of agents do different work. But for this simple In Memory project, you use only one agent of one type, and that is the inference agent. Inference agents listen for messages arriving at destinations, and transform them into events. The events trigger rules, using the agent’s Rete network and forward chaining, and the inference agent executes the rules.
What is a processing unit?  A processing unit is deployed as a BusinessEvents engine. It has one or more agents and it runs in one JVM. For In Memory OM, you generally don’t have to do much or any configuration of processing units. The default processing unit settings are sufficient.
More Information
In TIBCO BusinessEvents Administration, see these chapters:
Task R Add and Configure a CDD
1.
In Studio Explorer, right click the project name, FraudDetection, and select New > Cluster Deployment Descriptor. You see the New Cluster Configuration Wizard.
You can create multiple CDD files for a project and at deploy time use the one that has the configuration you want to use.
2.
Unlike other project resources, you can change the name later as desired. Short names are easier to type when starting the engine at the command line.
3.
At the Template Selection page, select In Memory from the Object Management Type drop-down list. Then click Finish.
You see the CDD editor, displaying the template for In Memory OM. For an In Memory project, very little deployment configuration is required.
4.
a.
Select Destinations and click Add.
b.
c.
A folder called Http appears in the Destinations node in the Collections panel. Select the Http folder and click Add. In the Select Destinations dialog, select /Channels/HTTP/AllOps and click OK.
d.
In the Select Destinations dialog, select /Channels/HTTP/AllOps and click OK.
e.
In the Configuration panel Destination ID field, type AllOperations, replacing the generated ID.
f.
In the Preprocessor field, select /RuleFunctions/PreProcessor.
g.
The Configuration panel looks like this:
Collections enable you to create resources you can reuse when configuring multiple agent classes. Collections are used here to demonstrate the feature. In simple projects, you could simply configure the agent class without using collections. Configure the collection as follows:
5.
When configuring an agent class, you can select a subset of the project rules, select and configure various destinations, and select rule functions that execute at engine startup and shut down, as needed. Thus different agent classes can behave quite differently at runtime.
6.
Select Destination Collections and click Add. You see the Select Destinations dialog. Under Reference Collections, select Http and click OK.
As mentioned above, you can configure destinations here, or refer to destinations configured in the Destination Collections tab.
7.
Select Startup Functions and click Add. In the Select Rule Functions dialog, select /RuleFunctions/InitializeScorecard and click OK. When the engine starts, this rule function executes and initializes the scorecard values.
8.
Task S Build the EAR File
You must build the EAR file outside the project tree, or it will be recursively included in the next EAR file you build!
1.
If you see a message asking you to save all project resources, click Yes. It means an unsaved resource editor is open.
At the Build Enterprise Archive dialog, you can change the name to fd. (Short names are easier to type when starting the engine at the command line.)
2.
In the File Location field, browse to and select the directory above the project directory. (To build the EAR in the provided example location, you would choose BE_HOME/examples/FraudDetection/FD.ear. Replace BE_HOME with your actual value.)
Where you build the EAR is not so important. You just have to specify the correct location when starting the engine at the command line.
3.
Press Apply, then press OK. You see messages as the EAR file builds, then you see a message that the EAR file has built correctly:
Summary and Next Step
You are ready to deploy the FraudDetection project!