Read me for EM Inbound Data Exchange Session Sample

This document has instructions and steps required to run a sample Data Exchange 
inbound session using Oracle BAM server.

Setup on the JMS Server side
1.	This sample uses the "jms/loanTopic" topic name.  JMS server used as the Data Hub 
	should be configured with this topic name. For OC4J, one can add this using ASControl.
        Here is a sample snippet to configure the "jms/loanTopic" in the
        $J2EE_HOME/config/jms.xml file.

        <topic name="LoanDetailsData" location="jms/loanTopic">
          <description>Loan Order topic</description>
        </topic>

Setup on the Oracle BAM Server side
1.	Import the necessary artifacts needed for this sample.
	a.	ICommand cmd=import file=inboundsession.xml
	b.	inboundsession.xml can be found under  $ORACLE_HOME/sysman/bam 
		directory
2.	Once the import is successful, the following 3 artifacts should have been created
	a.	"EMInboundSession Loan Details" data object  should be created under LoanApp 
		folder. This data object contains details about loans  such loan type, loan amount 
		and number of days taken for the loan to be approved
	b.	"EMInboundSession Loan Orders EMS" message  source definition to send the 
		loan orders data to the JMS server.
	c.	"EMInboundSession Loan Orders Plan" plan reads  the data from the data objects 
		and sends it over to the JMS Server
3.	Update the JNDI location in the  "EMInboundSession Loan Orders EMS" definition 
	corresponding to the JMS server.
4.      Running a Plan:
         Here is couple of ways of running a plan.
       	a. Manually run the ="EMInboundSession Loan Orders Plan" when ever you want the data to be sent from Oracle BAM to EM

        b. Schedule the Plan via the Alert mechanism. Here are some sample ways in doing the same:
           i. Create an Alert that launches this Plan in periodic intervals
              - Go to the Architect in Oracle BAM Server
              - Select the Alerts option in the upper left drop down list
              - Click on the 'Create a New Alert' link on the left menu
              - Click on 'Create a Rule' option
              - Specify some name for the Rule Name
              - Select the option that says 'Every interval between two times'
                option under 'Select an Event'.
              - Select the time interval (say every 3 minutes) and from and to
                times (say 8:00 am to 8:00 pm).
              - Click the Next button at the bottom when done
              - Select the "Run a Plan" option under "Select an Action"
              - Click on 'Select Plan'
              - Select the ="EMInboundSession Loan Orders Plan" plan. No parameters are needed.              - Select OK
          ii. Create an Alert that launches this Plan when ever data changes
	      - Go to the Architect in Oracle BAM Server
              - Select the Alerts option in the upper left drop down list
              - Click on the 'Create a New Alert' link on the left menu
              - Click on 'Create a Rule' option
              - Specify some name for the Rule Name
              - Select the option that says 'When a data field changes in a data object'
                option under 'Select an Event'.
              - Click on 'Select Data Field'  link.
              - Double click the LoanApp folder and then select 
                'EMInboundSession Loan Details' data object.
              - Select the LoanAmount field, the click "OK" button.
              - Click the Next button at the bottom when done
              - Select the "Run a Plan" option under "Select an Action"
              - Click on 'Select Plan'
              - Select the ="EMInboundSession Loan Orders Plan" plan. No parameters are needed.
              - Select OK

Setup on the Grid Control side
1.	Grid Control should have a Service instance to  which the incoming data should be 
	associated. If not one, a Service instance should be  created before proceeding further. 

2.	Create a Data Hub entry corresponding the JMS  server.
	a.	Login into Grid Control using an user with  super-user privileges and click on 
		'Setup' link on the top right
	b.	Once in Setup, click on the 'Data Exchange' in  the left panel
	c.	Click on the 'Data Exchange Hub' tab if not  already there
	d.	Click on 'Create' button
	e.	Enter a unique name for the hub
	f.	Enter the JNDI Service Provider URL, Username,  and Password for the JMS 
		server
	g.	Click 'Ok'

3.	Create an Inbound Data Exchange Session
	a.	Click the 'Inbound Data Exchange Session' tab on  the Data Exchange main page
	b.	Click on 'Create' button
	c.	Enter an unique name for this session and select the previously created Data Hub 
		in the drop down list and click 'Next'
	d.	Click on 'Add Business Indicators' to add business KPIs from BAM
	e.	Enter "Loan" as the Data Source name
	f.	Do not select the XML namespace option
	g.	Click on 'Add Indicator' and add 'LoanType' as  an indicator. Add 'LoanAmount' 
		and 'NoOfDaysForApproval' in similar fashion
	h.	Enter "jms/TopicConnectionFactory" in the TopicConnectionFactory Name field.
	i.	Enter "jms/loanTopic" for the Topic name
	j.	Enter "LoanDetailsData" for the Subscriber
	k.	If the JMS Topic in the JMS server was secured  by username/password, enter the 
		same. 
	l.	Click on "Test Connection" to make sure the JMS Topic lookup is successful.
	m.	Select the Service instance to which you want to  associate the incoming data
	n.	Click 'OK'
	o.	Click 'Next' to go the schedule page.
	p.	Schedule the session based on the incoming data

Running the demo
1.	Make sure the JMS server is up and running
2.	Make sure the inbound Data Exchange session is actively scheduled
3.	Go to BAM and add rows manually to the "EMInboundSession Loan Details" data 
	object
	a.	This can be done by clicking on 'Edit Contents'  button in the 'Contents' tab
4.	Once a row is added, alert is triggered that in  turn calls the Plan that reads the data 
	and sends out the data as an XML message to the JMS  server via the "jms/loanTopic" 
	topic.
5.	Grid Control in turn will be listening on those  topics as and when scheduled  will 
	read the data and persists the data.
6.	The data can be viewed from the 'Charts' tab in  the service home page for the Service 
	selected.


Dropping the artifacts used for demos.
The artifacts can be dropped either from the ICommand or using the Architect UI in 
Oracle BAM Server.

Using the ICommand:
1.	ICommand cmd=delete type=ems name="EMInboundSession Loan Orders EMS"
2.	ICommand cmd=delete type=plan  name="EMInboundSession Loan Orders Plan"
3.	ICommand cmd=delete name="/LoanApp/EMInboundSession Loan Details"

Or, using UI from Architect and Design Studio. One can delete the  EMS
and the data object from the Architect and the plan from the Design Studio.
