BPM and JMS Adapters
In our last chapter we saw how we can use BPM Composer for Run time process editing, lets extend the Application further more to use JMS Messaging.
In real life Admission Scenario. Once a student is Admitted there might be multiple process which might need to take action upon. his admission process would/ can trigger further one or more sub process.
for example A new student joining from SC / ST / OBC reservation category may need to under go “reservation process” where their applications might be submitted to government for Scolorship schemes ( financial aid from the goverment ) .
So lets extend the usecase once student is joined their data is broadcasted using JMS Messaging (Message Producer), there will be another Process which will be listening to these Messages (Message Consumer ), Make a note these processes are not directly connected or wired using wsdl service invocations. but they purely work on JMS message publish and subscribe
Weblogic JMS Module
Login to weblogic console . Navigate to Services -> Messaging -> JMS Module
Click on New Button, Give system module name
Click Next, Select Admin and SOA Server for deployment
Click Finish and Create New JMS System module resource as Queue
Give the Queue Name as “AdmissionQueue” and JNDI name as “eis/jms/AdmissionQueue”
Click Next, Create a New Sub Deployment “AdmissionQueue-Sub”
Click OK and select this sub deployment
Select the SOAJMS Server, Click Finish
Go to deployment and select JMS Adapter and Update the Deployment
JMS Message Producer
Use case : So far, we had student admission process where student enters his admission data from the Web UI and based on business rules which defines a cut off percentage , student’s admission is granted or rejected, rejected applications are written into file system as xml files, however accepted applications are sent to Admin officer for approval, later on Approved student data is written into Database . Students belonging to OBC Reservation category are handled by different service “Selected Students Process ” which basically writes into file system.
Now, Selected Student Process Produces JMS Message , which will be consumed by another service “New Admission Process” which also writes the data into file system but can be extended in future.
Go to “Selected Students Process” ‘s Composite drag n drop JMS Adapter on External Reference side of canvas.
Give the service name as StudentJMSWrite
Select Weblogic JMS
App Connection to SOA Server
Select Produce Message
Select Queue Destination , remember the name this is what that would be needed during JMS Message Consuming
Select the Student Admission Schema, import into project if needed
Go to BPM Process, Drag n Drop a Service activity after start
Give the name as Write JMS ( give any name which can make sense )
Use Association, Drag n Drop Student Data Object
Important : Ensure that you select and use transformation create new if required, if you dont put transformation and just pass data object you might get DOM Parsing Exception in translator Exception
This is how the composite would look like now
Deploy the BPM Process.
JMS Message Consumer
Now lets create a new BPM Process “New Admission Process” under a new BPM Project named “NewAdmissionProject” all this has to come under same application as a good practice , but that doesnt matter really.
On the Exposed Services side of the canvas insert JMS Adapter, Give the name as “StudentJMSRead”
Next, Message Consume
Select the eis/jms/AdmissionQueue whose JNDI name is eis/wls/Queue
Open the BPM Process , Edit the start button , In its implementation select the JMS Adapter that was defined on the composite, consume message will get automatically selected
Use Association and Use Transformation both
Drag n Drop Student Data object on association and create transformation, Save All and Deploy this process
Login to Enterprise Manager [EM], Click on Test Button over “Student Admission Project” fill in the payload data, ensure that the Percentage is above 70 and res class is OBC
Based on Business Rules Student data is sent for Admin Officer for approval , login to BPM Composer and Approve
Go Back to EM, View the End to End Instance Flow Trace, it should not show any errors
We can also view all the 3 flow diagrams of the BPM Process
Web Service Invocation of BPM Process
JMS Message Produce and Consume which causes “NewAdmissionProcess” to get triggered and Write Student Data into file system
Thank You !
Mail me at email@example.com
Follow me on above links