Friday, 10 October 2014

DB Adapter Wizard Issue After Exporting The SAR

Sometimes after export the BPEL SAR file from EM Console, if we try to open the DB adapter wizard it is not opening. We need to do the following work around to solve this,

Open the DB adapter wsdl file and add the .jca file name as mentioned below.

<?xml version='1.0' encoding='UTF-8'?>
<?binding.jca PL_INSERT_Data_db.jca?> 


Happy Coding :)

Thursday, 14 August 2014

BPEL Java Embeding Activity With Message Type Variables Manipulation

In Java Embedding activity we can deal with the BPEL variables using getVariableData() and setVariableData() methods.

For example, the below code snippet in java embedding activity get the input value of the BPEL process and concat it with a string and set the value into the output variable of BPEL.

Element input =(Element)getVariableData("inputVariable","payload","/client:process/client:input");      
Node fc= input.getFirstChild();     
String s = "Hii "+fc.getNodeValue();     
addAuditTrailEntry("Input is : " +s);     
setVariableData("outputVariable","payload","/client:processResponse/client:result", s);

In the BPEL process file go to source view and add the following import statements above the java embedding code snippet.

<bpelx:exec import="org.w3c.dom.Element"/>

<bpelx:exec import="org.w3c.dom.*"/>

Now deploy the project and test it.

Happy Coding :)

Tuesday, 15 July 2014

Fetch Number Of SOA Process Instances and Current State On Server

Execute the below query which fetch the number of process instances on the server and their current state.

SELECT 
decode (state,
         0 , 'Initiated',
         1 , 'Open and Running',
         2 , 'Open and Suspended',
         3 , 'Open and Faulted',
         4 , 'Closed and Pending',
         5 , 'Closed and Completed',
         6 , 'Closed and Faulted',
         7 , 'Closed and Cancelled',
         8 , 'Closed and Aborted',
         9 , 'Closed and Stale',
         'Unknown') "Process State",
COUNT (*) "Number Of Processes"
FROM dev_soainfra.cube_instance
WHERE creation_date < sysdate  AND creation_date > (sysdate-100)
GROUP BY state;

Output :











Happy Coding :)

Monday, 14 July 2014

Multiple End Point URI Set On partner Link

We can use endPointURI proporty to set multiple end points for a partner link. In case of any fail over of a uri it will invoke the other one. If all the endPOintURIs fail then default uri which is mentioned with wsdlLocation in the Reference tag will invoke.

For Example : 

Create a synchronous BPEL process and deploy it with 3 different versions which have return different output messages. Create another synchronous bpel process to test the multiple endpointURI. In the composite of this process create a partner link and set it with a BPEL process rev1.0. Go to source mode and add multiple endpointURI proporties in the reference tag. Follwo the below code snipet.

 <reference name="invkHelloworld"
             ui:wsdlLocation="http://localhost:8001/soa-infra/services/TESTING/HelloWorld!1.0/BPELProcess1.wsdl">
    <interface.wsdl         interface="http://xmlns.oracle.com/SOADemo/HelloWorld/BPELProcess1#wsdl.interface(BPELProcess1)"/>
    <binding.ws port="http://xmlns.oracle.com/SOADemo/HelloWorld/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)"
                location="http://localhoste:8001/soa-infra/services/TESTING/HelloWorld!1.0/bpelprocess1_client_ep?WSDL"
                soapVersion="1.1">
      <property name="endpointURI"> http://localhost:8001/soa-infra/services/TESTING/HelloWorld!2.0/bpelprocess1_client_ep?WSDL </property>
      <property name="endpointURI">http://localhost:8001/soa-infra/services/TESTING/HelloWorld!3.0/bpelprocess1_client_ep?WSDL</property>
      <property name="weblogic.wsee.wsat.transaction.flowOption"
                type="xs:string" many="false">WSDLDriven</property>
    </binding.ws>
  </reference>

Deploy and test the code. Check the following outputs

  • It will invoke the HelloWorld rev 3.0 by default if all the services are up.
  • If HelloWorld rev 3.0 is down then it invokes previous end point uri.
  • If all the end points are dow then it invokes default uri which is mentioned in location tag of <binding.ws>


Happy Coding :)



Wednesday, 9 July 2014

Create BAM Data Object Depending External DataBase Table

We can create a BAM Data Object bsed on a Data base Table structure. This data Object has all the data which are persist in the underlying data base table. We can link this table to BAM Data object through External Data Sources.

Follow the below steps

  • Login the BAM home -- Architect tab
  • Choose External Data Sources from the pop list top left corner. Click on Create link.












  • Give name, user, pasword, connection string of the Data source.


















  • Now create a BAM Data Object. On the screen choose the External Data Object check box.
  • Then choose the above created data source. It will populate all the tables present in the corresponding data base schema.
  • Choose the underlying table.

























  • Now add fields to the data Object one by one or we can also add all the fields at a time(it creates these field by mapping corresponding table columns).
  • Now click on Create Data Object.















  • Now Click on the created BAM Data Object and click on the contents link. It has all the values of the underlying table. Any data manipulation on the undelying table has also change the value of this BAM Data object automatically.












Also Check :



Give your comments on this post. Happy Coding :)
                    

BAM Adapter To Insert Values In BAM Data Object

Follow the below steps to populate values in a BAM Object from a BPEL process using BAM Adapter.


  • Create an One-way BPEL Process.
  • Drag a BAM adapter in the reference section in the BPEL Process.









  • Go through the BAM adapter wizard. Create a BAM server connection, Select the Data Object and  Operation type.





















  • We can do four type of operations i.e. insert, update, delete and upsert using a BAM adapter.











  • Invoke that BAM adapter partnerlink using an invoke activity and pass the values from input to the invoke activity variable.
















  • Deploy the process and test.
Input : 



BAM Data Object :

Go to BAM Architect -- Select Data Object -- Contents




















Check Also : Create BAM Data Object

Give your comments on this post. Happy Coding :)

Monday, 7 July 2014

Dynamic PartenerLink In BPEL Process

We can dynamically configure the WSDL on the partner link in BPEL process. Follow the below example.

Requirement: Depending upon input value of a BPEL process, will invoke a web service through the same partner link.

Note: For dynamic partner link all the invoking services should have same input message structure.
  • Create a Synchronous BPEL process TestProcess and deploy it with two different revision numbers, so that three WSDL will generate. The output of the BPEL process is as mentioned below.
    • TestProcess  rev1.0 : input String + process1
    • TestProcess  rev2.0 : input String + process1
  • Create another synch BPEL process CallTestProcess to invoke Testprocess depending upon input value i.e. if input value is 
    • process1 : invoke TestProcess  rev1.0
    • process2 : invoke TestProcess  rev2.0
  • Create a reference partnerlink in the CallTestProcess and configure it with the  TestProcess  rev1.0 process.
  • Create a variable of element type of WS-Addressing.xsd EndPointReference element which resides in the MDS shared repository.




































  • In BPEL take a switch activity and put condition as if the input string is process2 then assign the TestProcess  rev2.0 WSDLto the above created variable.









  • Assign the variable to the corresponding partner link in the assign activity copy rule.








  •  Now deploy the service and test. If you give process2 as input it will invoke the TestProcess  rev2.0 otherwise it will invoke TestProcess  rev1.0 process.


Give your comment on this post. Happy Coding :)


Create Oracle BAM DataObject

Business Activity Monitoring (BAM) is a SOA component used to monitor the SOA processes. Using BAM we can create various type of monitoring reports and  alerts to take a corresponding action such as sending a mail notification etc. .

In the BAM home we have the following artifacts.











  • Active Viewer: It is a graphical user interface used to view the reports.
  • Active Studio: It is used to create Reports, edit reports, share reports etc.
  • Architect: It is used to manage Data Objects.
  • Administrator: It is used for the user management of BAM.
BAM Data Object:  It is a table which contains the raw data for monitoring purpose.It has a combination of fields, lookup values and calculated fields. We can populate values to a BAM Object directly on BAM Architech, using a BAM Adapter in BPEL or creating the BAM Object based on an existing database table.

Below are the steps to create a BAM Data Object.
  • Click on Architect on the BAM Home screen.
  • Click on the Create Data Object link.
















  • Enter the name of the data object and fields as shown below.



















  • After the data object creation we can insert contents, give permissions, rename or move to a different directory and delete the object.



Check Also : BAM Adapter To Manipulate Data Object From BPEL Process

Give your comments on this post. Happy Coding :)

Monday, 16 June 2014

Generate Configuration Plan File For A SOA Composite

There is two ways to generate a plan file from the SOA composite.xml file.

1. Using Jdeveloper:

On the Application Navigator of Jdev right click on the composite.xml file and choose the 'Generate Config Plan' option. It will generate the config plan xml file inside the project folder.




























Now change all the replace tags in config plan file as per the New deployment environment and deploy the SOA process using the Jdev.

2. Using WLST Command

Login to the wlst server using the following commands.
  • Copy the project composite.xml file to any soa server location(/home/oracle) using any ftp software.
  • login as oracle user to the soa server using putty.
  • goto cd /u01/Middleware/Oracle_SOA1/common/bin
  • execute ./wlst.sh
  • connect to the wlst server with username,pwd and host name. connect('weblogic','admin123',"t3://host:7001");
  • Run below command to generate the plan file. The below command generate the config file name as myconfigplan.xml at /home/oracle directory using the composite file /home/oracle/composite.xml.
sca_generatePlan("/home/oracle/myconfigplan.xml",composite="/home/oracle/composite.xml",overwrite=true);

Also Check : WLST Scripting

Happy Coding :)

Thursday, 5 June 2014

Query To Find Out Available APIs In Oracle E-Business Modules

Execute the below query with required parameters in WHERE clause to get all the APIs present in a module.

select substr(a.OWNER,1,20)
, substr(a.NAME,1,30)
, substr(a.TYPE,1,20)
, substr(u.status,1,10) Stat
, u.last_ddl_time
, substr(text,1,80) Description
from dba_source a, dba_objects u
WHERE 2=2
and u.object_name = a.name
and a.text like '%Header%'
and a.type = u.object_type
and a.name like 'PO_%'
order by
a.owner, a.name;


Happy Coding :)

Monday, 2 June 2014

UOM Creation Script: Oracle EBS R12

Below mentioned is the sample script for Unit of Measure Conversion.

DECLARE
  x_row_id                          VARCHAR2(100) :=NULL;
  x_unit_of_measure         VARCHAR2(100) :='TESTUOM1';
  x_unit_of_measure_tl    VARCHAR2(100) :='TESTUOM1';
  x_attribute_category      VARCHAR2(100) :=NULL;
  x_attribute1             VARCHAR2(100) :=NULL;
  x_attribute2             VARCHAR2(100) :=NULL;
  x_attribute3             VARCHAR2(100) :=NULL;
  x_attribute4             VARCHAR2(100) :=NULL;
  x_attribute5             VARCHAR2(100) :=NULL;
  x_attribute6             VARCHAR2(100) :=NULL;
  x_attribute7             VARCHAR2(100) :=NULL;
  x_attribute8             VARCHAR2(100) :=NULL;
  x_attribute9             VARCHAR2(100) :=NULL;
  x_attribute10            VARCHAR2(100) :=NULL;
  x_attribute11            VARCHAR2(100) :=NULL;
  x_attribute12            VARCHAR2(100) :=NULL;
  x_attribute13            VARCHAR2(100) :=NULL;
  x_attribute14            VARCHAR2(100) :=NULL;
  x_attribute15            VARCHAR2(100) :=NULL;
  x_request_id             NUMBER        :=1;
  x_disable_date          DATE          :=NULL;
  x_base_uom_flag                                 VARCHAR2(100) :='N';
  x_uom_code                                          VARCHAR2(100) :='TUM';
  x_uom_class                                          VARCHAR2(100) :='MASS';
  x_description                                         VARCHAR2(100) :='MASS';
  x_creation_date                                     DATE          := SYSDATE;
  x_last_update_date                               DATE          := SYSDATE;
  x_last_update_login                              NUMBER;
  x_program_application_id                    NUMBER :=1;
  x_program_id                                          NUMBER := 1;
  x_program_update_date                      DATE   :=sysdate;
  l_user_id                                                NUMBER :=1318;
BEGIN
  apps.mo_global.init ('PO');
  apps.mo_global.set_policy_context ('S', 204);
  apps.fnd_global.apps_initialize ( user_id => 1318, resp_id => 50578, resp_appl_id => 201 );
  BEGIN
    apps.mtl_units_of_measure_tl_pkg.insert_row( x_row_id ,
                                                x_unit_of_measure ,
                                                x_unit_of_measure_tl ,
                                                x_attribute_category ,
                                                x_attribute1 ,
                                                x_attribute2 ,
                                                x_attribute3 ,
                                                x_attribute4 ,
                                                x_attribute5 ,
                                                x_attribute6 ,
                                                x_attribute7 ,
                                                x_attribute8 ,
                                                x_attribute9 ,
                                                x_attribute10 ,
                                                x_attribute11 ,
                                                x_attribute12 ,
                                                x_attribute13 ,
                                                x_attribute14 ,
                                                x_attribute15 ,
                                                x_request_id ,
                                                x_disable_date ,
                                                x_base_uom_flag ,
                                                x_uom_code ,
                                                x_uom_class ,
                                                x_description ,
                                                x_creation_date ,
                                                l_user_id ,
                                                x_last_update_date ,
                                                l_user_id ,
                                                x_last_update_login ,
                                                x_program_application_id ,
                                                x_program_id ,
                                                x_program_update_date );
    IF(x_row_id IS NOT NULL ) THEN
      dbms_output.put_line('UOM CREATED SUCCESSFULLY');
      dbms_output.put_line(' ROW ID : '||x_row_id);
      BEGIN
        INSERT
        INTO apps.mtl_uom_conversions
          (
            inventory_item_id,
            unit_of_measure,
            uom_code,
            uom_class,
            last_update_date,
            last_updated_by,
            creation_date,
            created_by,
            last_update_login,
            conversion_rate,
            default_conversion_flag
          )
          VALUES
          (
            0,
            x_unit_of_measure,
            x_uom_code,
            x_uom_class,
            SYSDATE,
            1318,
            SYSDATE,
            1318,
            -1,
            1.10,
            'N'
          );
      END;
commit;
    END IF;
    dbms_output.put_line('Unit of Measure created succesfully with UOM CODE '||'TESTUOM1');
  END;
  dbms_session.reset_package() ;
END;

Execute the below script for confirmation that UOM has been created.

SELECT * FROM apps.mtl_units_of_measure WHERE uom_code='TUM';


FNDLOAD for AOL Objects

Below mentioned are the list of FNDLOAD to Download and Upload for different AOL objects.

Functions

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct /u01/XX_CUSTOM_FUNCTION.ldt FUNCTION FUNCTION_NAME="XX_CUSTOM_FUNCTION"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct /u01/XX_CUSTOM_FUNCTION.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Menus

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct /u01/XX_CUSTOM_MENU.ldt MENU MENU_NAME="XX_CUSTOM_MENU"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct /u01/XX_CUSTOM_MENU.ldt UPLOAD_MODE=REPLACE

Messages

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct /u01/XX_CUSTOM_MESG.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME="XXCUST" MESSAGE_NAME="XX_CUSTOM_MESG"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct /u01/XX_CUSTOM_MESG.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE


Concurrent Programs

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct /u01/XX_CUSTOM_CP.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XX_CUSTOM_CP"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct /u01/XX_CUSTOM_CP.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE


Profile Options

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct /u01/XX_CUSTOM_PRF.ldt PROFILE PROFILE_NAME="XX_CUSTOM_PRF" APPLICATION_SHORT_NAME="XXCUST"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct /u01/XX_CUSTOM_PRF.ldt


Descriptive Flex Fields 

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct /u01/XX_PO_REQ_HEADERS_DFF.ldt DESC_FLEX APPLICATION_SHORT_NAME=PO DESCRIPTIVE_FLEXFIELD_NAME='PO_REQUISITION_HEADERS'

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct /u01/XX_PO_REQ_HEADERS_DFF.ldt


Forms Personalizations

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct /u01/XX_CUST_PERSONALIZATION.ldt FND_FORM_CUSTOM_RULES function_name="XX_CUST_FUNC"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct /u01/RCVRCERC.ldt









Friday, 30 May 2014

Pick Activity to Receive Multiple Response From Asynchronous BPEL Process

There are certain situations where BPEL process component should be capable of receiving multiple response from Asynchronous BPEL process.
Multiple onmessage branch of Pick activity can be used to receive multiple responses from service.

In below example it us described how to use Pick activity to receive multiple response from service.

To demonstrate we will create a BPEL process which invokes a Asynchronous BPEL process that returns two different response based on operation type(input parameter).

  • If operation type is "name" it returns first name
  • If operation type is "fullname" it returns first name and last name
To create this Asynchronous process click here.

Create a asynchronous BPEL process.


















































Open BPEL.xsd and modify the input elements.






















Open the BPEL process ,add Partenerlink and add the wsdl of AsynchNameDemo BPEL process created here.



















Add an Invoke activity and connect to this partenerlink.






















Add an assign activity above this invoke activity and assign input parameter for the AsyncNameService process.






















Now add an Pick activity below this Invoke activity. By default there will be a OnMessage branch. By clicking on the activity add one more OnMessage branch.

Click on first OnMessage,select your partnerlink "AsynchNameService" ,select the operation "processResponse" and add the variable too.





















Similarly for the second OnMessage branch handle the response from processFullNameResponse.





















Add and assign activity for each branch and assign the output variable the response received in respective onmessage response output variables.

Deploy the process and test.
  • For operation as "name"




























  • When operation name is "fullname"





































Asynchronous BPEL Process Returning Multiple Responses

There are certain scenarios in which an Asynchronous process can have multiple responses.

Lets assume an asynchronous process which accepts input parameters: firstName ,lastName and operations.
If operation is "name" it returns only First Name
If operation is "fullname" it returns  firstName and lastName.

As the returned values in both the cases are different number of items we need to use two different operations.

Create a new composite AsynchNameDemo and select composite with BPEL Process and click on Finish button.



















































Give the process name as BPELProcess and choose template as Asynchronous BPEL Process.























Open BPELProcess.xsd and edit it for appropriate request and response parameters.



























Open BPELProcess.wsdl file to add the appropriate changes.

  • Add a new meesage based on new response element processResponseFullName















  • Add a new operation in the callback porttype.











Now open BPEL process and add a switch activity.In the case branch add the condition that if operation='name' we will return only first name.
















Drag and bring the callbakClient inside case branch.Open the callbackClient and make assure that operation selected is processResponse. 

















Add as assign activity before this invoke and assign output parameter the first name as output.






















Delete the otherwise branch of switch activity and add one for condition branch and add the condition for operation as :"fullname".













Add a invoke activity in this case branch and name it as callbackClientwithFullName. Choose the operation type as processFullNameResponse and add an auto created input variable.






















Add an assign activity before this invoke activity and assign appropriate output variables for operation type "fullname".






















The complete process now looks like:-


























Now deploy the process and test.
  • When input is "name"



















  • When operation is "fullname"