2. Page 2 of 212
Table of Content
1 Installation................................................................................................................. 3
2 Channels, Events, Destinations, Rules .................................................................. 3
3 Building a CDD file and archive file ...................................................................... 21
4 Starting Project Locally.......................................................................................... 26
5 Running BE engine without default event in channel ........................................ 36
6 Using Schema, Event, Concept............................................................................. 38
7 Output Event ........................................................................................................... 52
8 JMS Channel/Destination....................................................................................... 57
9 JMS Reply Destination........................................................................................... 62
10 JMS destination using routeTo function.............................................................. 65
11 Timer Event Interval Based ................................................................................... 66
12 Timer Event Rule Based......................................................................................... 70
13 Advisory Event........................................................................................................ 78
14 Log Configuration................................................................................................... 85
15 Concepts ................................................................................................................. 86
16 Create An Instance Of Concept From Ontology Function ................................. 94
17 Time to live.............................................................................................................. 96
18 Consuming Events ................................................................................................. 99
19 Contained/Referenced Concept .......................................................................... 100
20 ScoreCard.............................................................................................................. 113
21 RuleFunction......................................................................................................... 117
22 Rank ....................................................................................................................... 117
23 Evaluate As A String ............................................................................................ 122
24 GlobalVariable....................................................................................................... 124
25 Inferencing ............................................................................................................ 126
26 ConflictResolutionCycle ...................................................................................... 126
27 BE SOAP Server ................................................................................................... 126
28 Creating Webservice Using Concrete WSDL..................................................... 141
29 B.E as a client ....................................................................................................... 147
30 B.E invoking a BW WSDL .................................................................................... 155
31 Caching.................................................................................................................. 161
32 Multicast Discovery URLS's ................................................................................ 178
33 Unicast Discovery Url's........................................................................................ 179
34 Listen Url ............................................................................................................... 180
35 Agent Classes ....................................................................................................... 180
36 Datamodelling/Storing Concepts To DB ............................................................ 182
37 Debug Mode .......................................................................................................... 202
38 Decision Manager................................................................................................. 204
3. Page 3 of 212
1 Installation
Install B.E 5.1.0
.
2 Channels, Events, Destinations, Rules
First open the B.E studio and create a workspace. This will be a place holder for the code created.
creating a new BE project. By right clicking in the Studio explorer
4. Page 4 of 212
Events, Concepts, Rules, Runtime environment, Scorecards are called ontology objects.( ontology is a
formal naming and definition of the types, properties, and interrelationships)
Clients will have to submit a request (event) to the b.e engine.
The point of entry to b.e environment is channel. Clients submit xml request to the be environment
through a channel.
creating a channel
9. Page 9 of 212
Now in the channel browse the HTTP shared resource that was just created
10. Page 10 of 212
What we have achieved so far is we have created a connection to a server. At run time the tomcat start up
and the BE engine is creating a connection to the tomcat,
We also have to create destinations. In BE destinations are listeners for the incoming request.(Just like
"JMS Queue Receiver", "Soap Event Source " in tibco BW)
creating a destination
11. Page 11 of 212
Now in the Include Event Type
When a client sends an xml string the channel converts it into a BE event this is called Deserializing
Converting Event into outgoing XML string by the channel is called Serializing
We will not select "Is Page Flow" in our case
13. Page 13 of 212
We will look at events in detail below.
14. Page 14 of 212
Now we will add properties in the event. If you want to have a great performance of the BE engine you can
communicate only by using properties instead of payload XML.
15. Page 15 of 212
Now go back to the channel and select this event that we have created here
19. Page 19 of 212
Now writing the action that rule needs to perform
type "System." studio automatically shows the different functions available that can be used
21. Page 21 of 212
3 Building a CDD file and archive file
Cluster deployment descriptor, you will configure your runtime configuration, the values that need to be
passed, whether it is an inference agent or cache agent, what destination should be added, what roles
should be added.
36. Page 36 of 212
5 Running BE engine without default event in channel
rebuild the ear and run the be engine locally and trigger a request from bw
So to over come this problem on the client side we can use the following BE name space
37. Page 37 of 212
<Header>
<Name>_nm_</Name>
<Value>customer</Value> (Name of the event)
</Header>
<Header>
<Header>
<Name>_ns_</Name>
<Value>www.tibco.com/be/ontology/Events/customer</Value> (Name space of the event)
</Header>
_ns_ is the name space of the event that you are asking your client to invoke
_nm_ is the name of the event.
Start the BW engine
The request shows up in the BE console
38. Page 38 of 212
What this means is BE will expose one destination, but the clients can invoke multiple events to that
destination.
6 Using Schema, Event, Concept
To import a schema into B.E
44. Page 44 of 212
Edit the rule function to get data from this xml.
45. Page 45 of 212
Rebuild the BE ear and start the BE engine locally
In the BW client add the customer schema and send it in the input body of HTTP post
the request is seen in the BE engine console.
51. Page 51 of 212
Now printing the value of OrderType to console. This value is got from the instance cpt which contains the
"OrderType" value from the Concept
Rebuild the BE ear and start the BE engine locally
52. Page 52 of 212
Send a request from the BW client you will see the message from the instance cpt display on the console
for OrderType
We can get the data from an event directly. But using concepts we can write the data to a cache agent..
7 Output Event
Create a new event called OrderEvent
create an instance of the event and map the values
53. Page 53 of 212
customer is the instance of incoming event
ord1 is the instance of outgoing event
rebuild the ear and start the b.e engine locally
58. Page 58 of 212
Create a shared JMS connection resource
Plugin the ems details and test connection
59. Page 59 of 212
the error means the jms.jar file is not in the BE libraries
Copy the jms.jar/tibjms.jar files to the tpcl folder
restart your studio
60. Page 60 of 212
Browse the connection that has just been created
rebuild the CDD file add this channel
61. Page 61 of 212
rebuild ear. Start the BE engine
Build the JMS client
create JMS application properties
the message shows up in the BE studio console
62. Page 62 of 212
9 JMS Reply Destination
Create a new JMS reply destination
In the order event select the reply destination that was just created
64. Page 64 of 212
Send a JMS message from the client
message shows up in BE
and the Order event sends out the message to the default outgoing destination
65. Page 65 of 212
the message is picked up by BW JMS receiver.
10 JMS destination using routeTo function
66. Page 66 of 212
rebuild the ear and start BE trigger the bw client
11 Timer Event Interval Based
Events are created in a cyclic manner at given intervals.
create a timer event
68. Page 68 of 212
Create a rule that fires when the Timer event that was just created gets asserted into BE memory
Update the CDD file with the new rule
69. Page 69 of 212
Build the ear and start the BE engine locally
70. Page 70 of 212
thereafter for every 15 seconds an event gets created.
12 Timer Event Rule Based
Change the Timer event to rule based.
71. Page 71 of 212
enable CatalogFunctions to show up in B.E if not already visible
74. Page 74 of 212
now in the Timer rule add a condition with the closure string
build the ear and start BE engine
trigger a request.
75. Page 75 of 212
Once the request is triggered you will see that the Customer rule gets fired which will trigger the timer
event. But it won't get asserted into the memory since the ClosureString do not match
Now edit the closer string to a different value in the "TimerEvent" and "CustomerRule"
77. Page 77 of 212
to map a value from incoming payload, it can be done as shown below
78. Page 78 of 212
13 Advisory Event
When ever there is an issue that occurs in BE, the advisory event get created and gets asserted into BE
engine. If there are any rules listening for this event those rules get triggered.
AdvisoryEvents need not be created they will be asserted into the BE memory automatically by the BE
engine.
create a rule
79. Page 79 of 212
to create this advisory event let us generate an error
80. Page 80 of 212
rebuild the CDD
build and run the be.ear. Trigger a message from BW client
81. Page 81 of 212
Sending an Advisory event to a JMS queue. Create an Event
83. Page 83 of 212
add this advisory event to the send Advisory event
84. Page 84 of 212
Once the destination is added into the Event. we will have to sendEvent
Build ear and run locally, trigger a JMS message from BW.
Create a BW JMS Receiver that will get a message from the BE jms channel created.
85. Page 85 of 212
14 Log Configuration
the log get created in the working directory folder
86. Page 86 of 212
15 Concepts
Concepts are place holders.
In BW we create mapper/SharedVariables, which are place holders, you don't store the data in concept but
will let you add incoming values to your concept and store in memory or if needed then persist them to DB.
94. Page 94 of 212
create ear and run the BW client.
16 Create An Instance Of Concept From Ontology Function
In the point 15 the values for the concept were instantiated manually, here we are going to see to create
them from ontology functions.
95. Page 95 of 212
Rebuild the ear and run the BW client
96. Page 96 of 212
17 Time to live
-1 the event never expires
0 the event expires at the end of RTC
+ number the event expires after set number of seconds (+1 after 1 second, +10 after 10 seconds)
98. Page 98 of 212
rebuild the ear and run the BE engine and BW client
99. Page 99 of 212
18 Consuming Events
build ear and trigger bw client
100. Page 100 of 212
19 Contained/Referenced Concept
101. Page 101 of 212
ContainedConcept :- Say there are two concepts "A" and "B". Concept "B" can be contained inside
concept "A", concept "A" is called Container/ParentConcept and "B" is called child concept.
RefrencedConcept :- Say there are two concepts "A" and "C". Concept "A" refers concept "C", put both
are in different locations not on the same RAM, which means A is referring concept C.
Create three concepts
102. Page 102 of 212
1)
2)
3)
Now in the concept "CustomerInfo" the property "CustomerDetails" will contain the "CustomerDetails"
concept
103. Page 103 of 212
Now in the concept "CustomerDetails" the property "Address" will reference the "Address" concept
104. Page 104 of 212
create a simple event matching the properties in the concepts.
105. Page 105 of 212
Create a rule
Add the address concept first in the rule
106. Page 106 of 212
Next add the CustomerDetails concept
117. Page 117 of 212
21 RuleFunction
RuleFunctions can be used to group a bunch of common actions together to be used inside a rule. Fore
example say you want to log ever event to a file, the logic can be maintained in a RuleFunction and then
called in the rule. Startup and Shutdown functions can be mentioned inside the rule function.
22 Rank
Say there are two rules that are going to get triggered due to same event and also have the same priority,
in that case if you want to have the say in which rule first gets triggered you will use RuleFunction.
118. Page 118 of 212
create a RuleFunction that will return a double value (Rank can be 1,2,3 or 1.1,1.2,1.3,1.4)
121. Page 121 of 212
creating another RuleFunction and adding to second rule having same event and priority value.
adding the RuleFunction to the priority in the rule
122. Page 122 of 212
Build the ear and trigger a request, the Rule with the higher rank get executed first (Rank 4 vs Rank 3)
23 Evaluate As A String
To use an xpath function such as dateTime() as a string.
124. Page 124 of 212
24 GlobalVariable
GlobalVariablesView you can look at the current global variables in the project
GlobalVariablesEditor you can edit the global variables in the project.
creating a GV
126. Page 126 of 212
25 Inferencing
Pre-RTC
Messages are received through Channels with specified destinations.
Event PreProcessor is executed first (if it exists in the project).
RTC
Incoming message is converted to an event.
Rules are triggered based on event.
Post-RTC
Acknowledge message, Write to Cache.
26 ConflictResolutionCycle
A rule agenda that get created based on the multiple rules that needs to be executed. Once all the rules in
a RuleAgenda are executed based on the configurations/priority/ranking then it is stated as one
ConflictResolutionCycle is completed.
27 BE SOAP Server
Create a new project
127. Page 127 of 212
import a schema into BE
create a Event
145. Page 145 of 212
build a new ear
and start the BE engine.
Export the WSDL from BE
146. Page 146 of 212
Import the WSDL into BW client and trigger a request
147. Page 147 of 212
b.e sends the response back to b.w.
29 B.E as a client
Create a webservice receiver in b.w using soap event source.
use the WSDL created in point 27
158. Page 158 of 212
now we need to capture the response for which we will have to do a HTTP.sendrequest(String url,
SimpleEvent requestEvent, String responseEventURI, long timeoutMillis, Object httpConnectionInfo)
160. Page 160 of 212
build a CDD file
build the ear.
Run be engine.
Every 15 seconds the timer event gets triggered and sends a webservice call.
161. Page 161 of 212
31 Caching
Concept data can be stored in cache. In the backend B.E uses activespaces to store cache.
Cache is JMV only store. The cache can also be stored in backend DB, for data persistence.
inferenceEngine > cacheAgent(seeder(store and provides data from database)).
Channels will not get activated until one cache agent is not available in the cluster. It is always a good
practice to start the cache agent first then inference agent.
Before we proceed further with caching. Create a simple http project with request reply event and a bw
client.
173. Page 173 of 212
save the CDD
build the ear.
first start the cache agent
the cache server becomes activated
174. Page 174 of 212
now start the inference agent by selecting the default processing unit
175. Page 175 of 212
you will see two agents running.
trigger a request from BW the concept will get created
176. Page 176 of 212
if a concept with the same extId is present in memory then new instances of that concept won't be created.
To check if an instance of a concept is already existing in memory we need to do the following.
177. Page 177 of 212
rebuild the ear. And trigger request from BW.
178. Page 178 of 212
Active space monitoring tool can used view the cache.
32 Multicast Discovery URLS's
There are two types of discovery url's Multicast(by default be uses Multicast) and Unicast
Multicast:- tibpgm://destinationport/network
tibpgm://7888/;239.8.8.9
tibpgm://7888/10.1.2.3;239.8.8.9
179. Page 179 of 212
33 Unicast Discovery Url's
There are two types of discovery url's Multicast(by default be uses Multicast) and Unicast
If there are four engines in cluster then you will have to give the url as follows. (3 inference agents and 1
cache agent)
unicast:- tcp://10.1.2.3.4:7888,tcp://10.1.2.3.5:7888,tcp://10.1.2.3.6:7888;tcp://10.1.2.3.7:7888
182. Page 182 of 212
36 Datamodelling/Storing Concepts To DB
For this part we will also need the data modelling to be installed
Once the DataModeling is installed you will be able to see it in studio
183. Page 183 of 212
First make sure the necessary DB jar file is copied to the tpcl folder.
Copy the ojdbc6.jar to the tpcl folder in case you are using oracle DB
Create a shared DB connection in shared resources