Transfer Workflows business events
Written by Anil Passi   
Saturday, 03 February 2007
This article explains how you can move the workflow events and their subscriptions from one environment to another. In any implementation, it is a good practice to script as much of your setup when preparing for UAT or go-Live.
Whilst we have Oracle FNDLOAD for moving most of the Sysadmin setups, it however does not cover Oracle Workflow events.

For basics of Oracle Workflow events, use the links below
Oracle Workflows Business Events - How to create and raise Event with XML Payload
Oracle Workflows Business Events - How to parse XML Payload, via Workflow Events Subscription  
Testing Oracle Workflow Business Event with XML Payload


Lets undertake some Q&A for transferring workflow events?


What is the name of the utility for downloading and uploading workflows events?
wmximport, its a java class available in package oracle.apps.fnd.wf


Can wmximport be run in both upload and download mode?
Indeed, just like FNDLOAD, but syntax differs
In this case you have -u for upload, whereas you use -d to download


What other parameters are required by this utility?
1. Name of the event
2. Database Machine name :- used for jdbc connection
3. Database port number
4. Event file name [into which you download or upload from]
5. Flag to indicate EVENT or SUBSCRIPTION


What if the event already exists on production environment, and hence I am only interested in moving the subscription?
You can either download just the workflow event definition or all its subscriptions too. In the sample below, I am listing the commands for transferring events and also transferring subscriptions.

What is the syntax of this command ?

The components of this syntax for WFXLoad are listed below. These need to be on one single line, but for clarity I have broken the parameters into individual lines
adjava WFXLoad -d[to indicate download or upload :-u]
appsusername apps-password
Database Machine name
Database Port Number
Oracle Instance Name[from two task]
thin   [for jdbc thin driver connectivity]
Language [US in this case]

Event/Subsctiption File Name [into which event definition is downloaded or uploaded from]
EVENTS or SUBSCRIPTION
Name of the event


How do I generalize the script without hardcoding machine name and db port number?
Use the sample script below, which gets the machine name and port numbers from Profile options[as below]

On command prompt set the apps password
APPS_PWD=apps
Export $APPS_PWD


Include this in your script
####Start of the script
MACHINE_NAME=0
PORT_NUMBER=0

export MACHINE_NAME
export PORT_NUMBER
    MACHINE_NAME=`sqlplus -s apps/$APPS_PWD <<EOF
                       set pages 0
                       set lines 1023
                       select fnd_profile.value('CSF_EMAP_DS_HOST')  from dual ;
                       exit
                       EOF`

    PORT_NUMBER=`sqlplus -s apps/$APPS_PWD <<EOF
                        set pages 0
                        set feed off
                        select fnd_profile.value('CSF_MAP_DB_PORT') from dual ;
                        exit
                        EOF`

#SUBSCRIPTIONS or EVENTS
adjava oracle.apps.fnd.wf.WFXLoad -d apps $APPS_PWD $MACHINE_NAME:$PORT_NUMBER:$TWO_TASK thin US ./XX_IRCSIGNFAIL_EVENT.wfx EVENTS xxirc.oracle.apps.fnd.signon.failure

adjava oracle.apps.fnd.wf.WFXLoad -d apps $APPS_PWD $MACHINE_NAME:$PORT_NUMBER:$TWO_TASK thin US ./XX_IRCSIGNFAIL_SUBSCRIPTION.wfx SUBSCRIPTIONS xxirc.oracle.apps.fnd.signon.failure
#end of script



How does the downloaded file look like?
The event file looks like below
<?xml version = '1.0' encoding = 'UTF-8'?>
<!-- $Header: WFXLoad.java 115.39 2006/04/18 05:19:59 vshanmug ship $ -->
<!-- dbdrv: exec java oracle/apps/fnd/wf WFXLoad.class java &phase=daa+38 \ -->
<!-- dbdrv: checkfile:~PROD:~PATH:~FILE \ -->
<!-- dbdrv: -u &un_apps &pw_apps &jdbc_db_addr &jdbc_protocol US \ -->
<!-- dbdrv: &fullpath_~PROD_~PATH_~FILE -->
<!-- Source Database ITUPDV2 -->

<oracle.apps.wf.event.all.sync><ExternalElement>
<OraTranslatibility>
<XlatElement Name="WF_EVENTS">
<XlatID>
<Key>NAME</Key>
</XlatID>
<XlatElement Name="DISPLAY_NAME" MaxLen="80"
Expansion="50"/>
<XlatID>
<Key Type="CONSTANT">DISPLAY_NAME</Key>
</XlatID>
<XlatElement Name="DESCRIPTION" MaxLen="2000"
Expansion="50"/>
<XlatID>
<Key Type="CONSTANT">DESCRIPTION</Key>
</XlatID>
</XlatElement>
</OraTranslatibility>
</ExternalElement>
<WF_TABLE_DATA>
   <WF_EVENTS>
      <VERSION>1.0</VERSION>
      <GUID>#NEW</GUID>
      <NAME>xxirc.oracle.apps.fnd.signon.failure</NAME>
      <TYPE>EVENT</TYPE>
      <STATUS>ENABLED</STATUS>
      <GENERATE_FUNCTION/>
      <OWNER_NAME>SYSADMIN</OWNER_NAME>
      <OWNER_TAG>SYSADMIN</OWNER_TAG>
      <CUSTOMIZATION_LEVEL>U</CUSTOMIZATION_LEVEL>
      <LICENSED_FLAG>Y</LICENSED_FLAG>
      <JAVA_GENERATE_FUNC/>
      <DISPLAY_NAME>xxirc.oracle.apps.fnd.signon.failure</DISPLAY_NAME>
      <DESCRIPTION/>
   </WF_EVENTS>
</WF_TABLE_DATA>
</oracle.apps.wf.event.all.sync>


How does the SUBSCRIPTION file look like?
It looks like below, keeping in mind this specific subscription is a PL/SQL
<?xml version = '1.0' encoding = 'UTF-8'?>
<!-- $Header: WFXLoad.java 115.39 2006/04/18 05:19:59 vshanmug ship $ -->
<!-- dbdrv: exec java oracle/apps/fnd/wf WFXLoad.class java &phase=daa+39 \ -->
<!-- dbdrv: checkfile:~PROD:~PATH:~FILE \ -->
<!-- dbdrv: -u &un_apps &pw_apps &jdbc_db_addr &jdbc_protocol US \ -->
<!-- dbdrv: &fullpath_~PROD_~PATH_~FILE -->
<!-- Source Database ITUPDV2 -->
<oracle.apps.wf.event.all.sync>
<WF_TABLE_DATA>
   <WF_EVENT_SUBSCRIPTIONS>
      <VERSION>1.0</VERSION>
      <GUID>#NEW</GUID>
      <SYSTEM_GUID>#LOCAL</SYSTEM_GUID>
      <SOURCE_TYPE>LOCAL</SOURCE_TYPE>
      <SOURCE_AGENT_GUID/>
      <EVENT_FILTER_GUID>xxirc.oracle.apps.fnd.signon.failure</EVENT_FILTER_GUID>
      <PHASE>1</PHASE>
      <STATUS>ENABLED</STATUS>
      <RULE_DATA>MESSAGE</RULE_DATA>
      <OUT_AGENT_GUID/>
      <TO_AGENT_GUID/>
      <PRIORITY>50</PRIORITY>
      <RULE_FUNCTION>xxirc_signon_breach_pkg.process_invalid_login</RULE_FUNCTION>
      <JAVA_RULE_FUNC/>
      <STANDARD_TYPE/>
      <STANDARD_CODE/>
      <ON_ERROR_CODE>ABORT</ON_ERROR_CODE>
      <ACTION_CODE>CUSTOM_RG</ACTION_CODE>
      <WF_PROCESS_TYPE/>
      <WF_PROCESS_NAME/>
      <PARAMETERS/>
      <OWNER_NAME>SYSADMIN</OWNER_NAME>
      <OWNER_TAG>SYSADMIN</OWNER_TAG>
      <CUSTOMIZATION_LEVEL>U</CUSTOMIZATION_LEVEL>
      <LICENSED_FLAG>Y</LICENSED_FLAG>
      <DESCRIPTION/>
      <EXPRESSION/>
   </WF_EVENT_SUBSCRIPTIONS>
</WF_TABLE_DATA>
</oracle.apps.wf.event.all.sync>

Comments (12)add
...
written by Ambati , February 03, 2007
Hi
Anil,
Thanks for the article,

Can you explain the WFXImport Syntax More Elaborately?
...
written by Anil Passi , February 04, 2007
Hi Ambati

Please let me know which bit do you want me to elaborate upon?

Thanks,
Anil Passi
...
written by Ambati , February 04, 2007
Hi
Anil,

Thanks for the article, Can you Please Elaborate the wmximport command
...
written by Ambati , February 05, 2007
Hi
Anil,

Thanks for early response. Now I under stand every thing
...
written by Rathan , February 19, 2007
Anil
Great website for Oracle Apps and efforts to write many topics.
I wanted to know if you have created any or have any standards documents for creating/customzing WF in Oracle Apps environment.
Thanks
Rathan.
...
written by Disha1 , September 06, 2007
Hi Anil,

When I am creating an event attribute with event action as receive, how do i pass the correlation_id? Does the system automatically passes this id or do i need to create a sequence and then pass it as correlation_id?

Please advice...

Thanks...
Disha
WorkFlow and web service integration
written by Ajitha , October 10, 2007
I have a work flow event that will be raised when ever a purchase order is placed. I have to subscribe to this event and call a web service whenever I receive the notification. Can I achieve this using XML Gateway. I am a newbie to workflow and XMLGateway so please suggest me any alternatives as well.
Call webservice from p/sql itself
written by Anil Passi , October 10, 2007
Hi Ajitha

Not sure which version of 11i/12i are you using
For 11i you can subscribe a pl/sql to the business event and from that pl/sql[metalink note 221854.1 ] you can invoke the web service [...R12 has out of the box integration though between WSDL and WF Events]


Thanks,
Anil Passi
WorkFlow and web service integration
written by Ajitha , October 15, 2007
Hi Anil,

Thanks a lot for the information. I could invoke my web service succesfully from the java rule function.
Also I came across a new feature in R12. Thought I will post it here for future reference. Inorder to invoke a BPEL process or any other web service we have to specify
"oracle.apps.fnd.wf.bes.WebServiceInvokerSubscription" in the Java Rule function.
Also the following 5 parameters have to be specified in the Event parameters section
SERVICE_WSDL_URL http://xyz.com:7777/orabpel/de...n/1.1?WSDL
SERVICE_NAME Workflowintegration
SERVICE_PORTTYPE Workflowintegration
SERVICE_OPERATION initiate
SERVICE_PORT WorkFlowIntegrationPort
This will be helpful in invoking a simple web service without any parameters. If we have any parameter passing or any custom validations we can do it by extending the class
WebServiceInvokerSubscription and by specifying in the Java Rule function.

Thanks
Ajitha
Great Stuff Ajitha
written by Anil Passi , October 16, 2007
Thanks for these details Ajitha.

Regards,
Anil Passi
BPEL/ESB with oracle apps
written by Shiv Saroj , October 16, 2007
Nice discussion Anil. There are some pre built point of invocations with respect to BPEL or generic web service in EBIZ. Let me dig it out and will update the same later on.
Business Events on creation of Sales Order on Oracle APPS
written by Lalit , December 11, 2007
I am new to Oracle apps I want to know how to do we create Business events and subscribe when a sales order in Oracle APPS.
You must be logged in to a comment. Please register if you do not have an account yet.

busy