jmsusingactivemq 29/12/2008,00:47 31.26 Kb
Summary:
This use case illustrates functionality of sending and receiving JMS message using ActiveMQ server.
This process is using “TestServiceWS.wsdl.” file that is used for sending and receiving message by using ActiveMQ server. In this process user gives any input say “Hello Intalio” and displays same as the output. This output is also visible on the server console.
Use case dependencies:
JMSSchema.xsd: Schema used is "sendString" which is of "string" type.
Requirements:
1.Intalio BPMS Designer 5.2.
2.Intalio BPMS Server 5.2 .
3.Active MQ 4.1.0-incubator.jar file.
4.Axis2 version 1.3.
5.TestServiceWS.aar.
6.TestServiceWS.wsdl.
Configurations in Server:
1.Download ActiveMQ 4.1.0 binary version for windows from below given link:
http://activemq.apache.org/activemq-410-release.html
2.Extract the zip file in any of the drive say C:\ drive.
3.Copy"apache-activemq-4.1.0-incubator.jar" file given in the apache-activemq-4.1.0-incubator folder and paste it in lib folder given under [intalio|BPMS server]\repository\com\intalio\bpms\axis2-services\1.1.1\axis2-services-1.1.1.war\WEB-INF\lib.
4.Again copy "apache-activemq-4.1.0-incubator.jar" file given in the apache-activemq-4.1.0-incubator folder and paste it in lib folder given under [intalio|BPMS server]\repository\com\intalio\bpms\axis2-services\1.1.1\axis2-services-1.1.1.war\WEB-INF\services\lib.
5.Restart the server
Preconditions:
1.Make sure Intalio|BPMS Server is up and running fine.
2.Make sure the Process Explorer pane does not contain any Intalio|BPMS Business Process Project with same name.
Process Download & Import:
1.Download 'JMSUsingActiveMQ.zip'.
2.Go to File > Import...
3. Select 'Existing Projects into Workspace', in the wizard, click on Next >
4. Browse to select the downloaded archive file & Click to Finish.
5. Update project builders by right click on project; go to BPMS Designer Tools > Update BPMS Builders.
Steps to remake the process:
1.Go to File > New > select “Intalio|BPMS Process Project”.
2.Provide Project name as “JMSUsingActiveMQ”, click on Finish.
3.Right click on the project; go to New > "Business Process Diagram".
4.Import wsdl file "JMSServiceWS.wsdl" from zip file attached, directly under "JMSUsingActiveMQ" project.
5.A pool with a task is available in BPMN Editor Pane, name default pool as 'Client' and task as 'send'.
6.Right click on client pool and select "Set pool non executable".
7.Add new pool by click on BPMN Editor (select "Add Pool" option from pop up menu) and name it as "SendReceiveJMS".
8.Focus on send task in Client pool, drag the out going message icon from boundary and release mouse control onto SendReceiveJMS pool to select the option "Connect to a new Message Start Event" and name as “start”.
9.Focus on Message Start Event, drag sequence flow icon from boundary and select option to "Connect to a new Task", name the task as "invoke".
10.Focus on invoke task, drag sequence flow icon from boundary and select option to "Connect to a new Message End Event" and name as “reply”.
11.Drag the outgoing message icon from Message End Event and connect to "send" task in the Client Pool.
12.Repeat step 6 & 5, but name the pool as "JMSUsingActiveMQ".
13.Drag and drop "Send" operation onto JMSUsingActiveMQ pool (Go to Process Explorer > TestServiceWS.wsdl > TestServiceWS > TestService).
14.Focus on invoke task in SendReceiveJMS pool, drag the outgoing message icon from "invoke" task and connect to "Send" task in SendReceiveJMS pool, similarly create connection in vice versa direction.
15.Import schema files from zip file into the project (You can also create your own schema from File > New > Other > XML > XML Schema).
16.Drag and drop JMSSchema.xsd > tns:sendString schema node on to incoming message flow from "send" task to message start event.
17.A message "Set schema element 'sendString' as the content of the message" will prompt you, click on it.
18.Save the process.
Defining Outgoing Mapping:
1.Make sure Mapper view is visible (go to Windows > Show View > Mapper).
2.In the process model select "invoke" task.
3.Connect "$thisStartRequestMsg.body" node in left side of mapper with "$ns0SendRequestMsg.InputParametersSearch$" node in right side of mapper.
4.Select reply end event in process model.
5.Connect "$ns0SendResponseMsg.Response" node in left side of mapper with "thisStartResponseMsg.body$" node in right side of mapper.
6.Save the process model.
Now your process is fully implemented to and is valid to deploy and execute within Intalio|BPMS Server.
Process Deployment & Execution:
1.Click on Deploy Project to Intalio|BPMS Server button in tool bar.
2.Make sure you select all runtime files while exporting to Intalio|BPMS Server.
3.Click on Finish button.
4.Open a web browser, provide url as: http://localhost:8080/bpms-console which takes to login screen for bpms-console.
5.Login with the following credentials:
username: 'admin' (without quotes).
password: 'changeit' (without quotes).
6.In the processes list you should see "JMSUsingActiveMQ:SendReceiveJMS" process with a package name "JMSUsingActiveMQ", select it and click to Start.
7.This should generate a form with an input field “startRequest”.
8.Type “Hello Intalio” in “startRequest” field, then click on Submit button.
9.This will replace the page with an output: startResponse: Hello Intalio.
10.This output is also visible on the server console:
Sent message: 17311471 : Hello Intalio
Received: Hello Intalio
11.Similarly, you can obtain results for other values.
Work Scenario in the Axis 2:
(To upload "TestServiceWS.aar" in the Axis2)
1.Make sure Intalio-bpms server is already started.
2.Open a web browser, provide url as:http://localhost:8080/axis2/., that takes to login screen for axis2.
3.Click on the "Administration" link.
4.Login with the following credentials:
username: 'admin' (without quotes) .
password: 'axis2' (without quotes).
5.Click on the link to "Upload Service".
6.Browse to location of "TestServiceWS.aar" to upload a “AxisService Archive” file.
7.Now click on Available Services link and refresh the webpage .
8.Verify that "TestServiceWS.wsdl" is present there.
9.Click on the "TestServiceWS.wsdl" it displays respective wsdl file.
Note: This wsdl displays users IP address in place of localhost in soap address location. You need to save this wsdl file on your system and you need to use this wsdl in place of the existing wsdl.
Notes:
This sample is an example to educate user on:
1.How to use JMS within the Intalio process.
2.How to deployed and execute JMS process by using ActiveMQ server.
3.How to send and receive JMS messages via user interface (bpms-console).
4.How to configure JMS in the server.
