Tuesday, May 31, 2016

How to Enqueue messages in Oracle B2B 10g

Login to B2B DB and Execure following SQL. Check instances in BPEL console..

DECLARE
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
msg_handle RAW(16);
ipmsg IP_MESSAGE_TYPE; /* xml_payload varchar2(30000); */
xml_clob clob;
msg_id number(10);
subscribers dbms_aq.aq$_recipient_list_t;
BEGIN
select message_seq.nextval into msg_id from dual; /* xml_payload :='<?xml version="1.0" encoding="UTF-8"?>'; */
xml_clob := '<Transaction-850 XDataVersion="1.0" Standard="X12" Version="V4010" CreatedDate="2015-11-04T13:10:05" CreatedBy="ECXEngine_837" GUID="{6FF097A6-8338-11E5-AD8F-005056927AFA}" xmlns="urn:oracle:integration:b2b:BE11ASDFDFGDFGDF$%9C4AC9ECD7CF09DF" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <Internal-Properties>
      <Data-Structure Name="Interchange">
         <Lookup Name="InterchangeSenderQual">12</Lookup>
         <Lookup Name="InterchangeSenderID">78254675</Lookup>
         <Lookup Name="InterchangeReceiverQual">ZZ</Lookup>
         <Lookup Name="InterchangeReceiverID">MYCOMP</Lookup>
         <Lookup Name="InterchangeControlVersion">00401</Lookup>
         <Lookup Name="Standard">X12</Lookup>
         <Property Name="InterchangeAuthorizationInfoQual">00</Property>
         <Property Name="InterchangeAuthorizationInfo"></Property>
         <Property Name="InterchangeSecurityInfoQual">00</Property>
         <Property Name="InterchangeSecurityInfo"></Property>
         <Property Name="InterchangeSenderQual">12</Property>
         <Property Name="InterchangeSenderID">3423423423</Property>
        <Property Name="InterchangeReceiverQual">ZZ</Property>
         <Property Name="InterchangeReceiverID">MYCOMP</Property>
         <Property Name="InterchangeDate">151104</Property>
         <Property Name="InterchangeTime">1312</Property>
         <Property Name="InterchangeControlStandard_RepeatingSeparator">U</Property>
         <Property Name="InterchangeControlVersion">00401</Property>
         <Property Name="InterchangeControlNumber">000000005</Property>
         <Property Name="InterchangeAckRequested">0</Property>
         <Property Name="InterchangeUsageIndicator">T</Property>
         <Property Name="InterchangeComponentElementSep">0x3e</Property>
         <Property Name="DecimalSeparator"/>
         <Property Name="ElementDelimiter">0x2a</Property>
         <Property Name="ReleaseCharacter"/>
         <Property Name="RepeatingSeparator"/>
         <Property Name="SegmentDelimiter">0x7e</Property>
         <Property Name="SubelementDelimiter">0x3e</Property>
         <Property Name="InterchangeChildCount">1</Property>
         <Property Name="InterchangeTrailerControlNumber">000000005</Property>
         <Data-Structure Name="Group">
            <Lookup Name="GroupSenderID">7097458884</Lookup>
            <Lookup Name="GroupReceiverID">MYCOMP</Lookup>
            <Lookup Name="GroupVersionNumber">004010</Lookup>
            <Property Name="GroupID">PO</Property>
            <Property Name="GroupSenderID">7097458884</Property>
            <Property Name="GroupReceiverID">MYCOMP</Property>
            <Property Name="GroupDate">20151104</Property>
            <Property Name="GroupTime">1312</Property>
            <Property Name="GroupControlNumber">5</Property>
            <Property Name="GroupAgencyCode">X</Property>
            <Property Name="GroupVersionNumber">004010</Property>
            <Property Name="GroupChildCount">1</Property>
            <Property Name="GroupTrailerControlNumber">5</Property>
            <Data-Structure Name="Transaction">
               <Lookup Name="TransactionID">850</Lookup>
               <Property Name="TransactionID">850</Property>
               <Property Name="TransactionControlNumber">0001</Property>
               <Property Name="TransactionImplementationReference"/>
               <Property Name="TransactionChildCount">11</Property>
               <Property Name="TransactionTrailerControlNumber">0001</Property>
            </Data-Structure>
         </Data-Structure>
      </Data-Structure>
   </Internal-Properties>
   <Segment-ST>
      <Element-143>850</Element-143>
      <Element-329>0001</Element-329>
   </Segment-ST>
   <Segment-BEG>
      <Element-353>00</Element-353>
      <Element-92>NE</Element-92>
      <Element-324>0108696</Element-324>
      <Element-328 xsi:nil="true"/>
      <Element-373>20151015</Element-373>
   </Segment-BEG>
   <Loop-N1>
      <Segment-N1>
         <Element-98>BT</Element-98>
         <Element-93 xsi:nil="true"/>
         <Element-66>9</Element-66>
         <Element-67>7097458884</Element-67>
      </Segment-N1>
   </Loop-N1>
   <Loop-N1>
      <Segment-N1>
         <Element-98>ST</Element-98>
         <Element-93>AMC Inc.</Element-93>
         <Element-66>9</Element-66>
         <Element-67>0000</Element-67>
      </Segment-N1>
      <Segment-N3>
         <Element-166>xyz Avenue, Suite 901</Element-166>
      </Segment-N3>
      <Segment-N4>
         <Element-19>Vera</Element-19>
         <Element-156>NL</Element-156>
         <Element-116>A1N 4S2</Element-116>
      </Segment-N4>
   </Loop-N1>
   <Loop-PO1>
      <Segment-PO1>
         <Element-350>1</Element-350>
         <Element-330>2</Element-330>
         <Element-355_1>EA</Element-355_1>
         <Element-212>1313.5</Element-212>
         <Element-639 xsi:nil="true"/>
         <Element-235_1>UP</Element-235_1>
         <Element-234_1>3428423423</Element-234_1>
      </Segment-PO1>
   </Loop-PO1>
   <Loop-PO1>
      <Segment-PO1>
         <Element-350>2</Element-350>
         <Element-330>1</Element-330>
         <Element-355_1>EA</Element-355_1>
         <Element-212>1391.68</Element-212>
         <Element-639 xsi:nil="true"/>
         <Element-235_1>UP</Element-235_1>
         <Element-234_1>23423423423</Element-234_1>
      </Segment-PO1>
   </Loop-PO1>
   <Loop-PO1>
      <Segment-PO1>
         <Element-350>3</Element-350>
         <Element-330>2</Element-330>
         <Element-355_1>EA</Element-355_1>
         <Element-212>857.13</Element-212>
         <Element-639 xsi:nil="true"/>
         <Element-235_1>UP</Element-235_1>
         <Element-234_1>234234234</Element-234_1>
      </Segment-PO1>
   </Loop-PO1>
   <Loop-CTT>
      <Segment-CTT>
         <Element-354>3</Element-354>
         <Element-347>5</Element-347>
      </Segment-CTT>
   </Loop-CTT>
   <Segment-SE>
      <Element-96>11</Element-96>
      <Element-329>0001</Element-329>
   </Segment-SE>
</Transaction-850>';
subscribers(1) := SYS.AQ$_AGENT('X12_4010_850_PO', null, null);
message_properties.RECIPIENT_LIST := subscribers;
ipmsg := IP_MESSAGE_TYPE
(msg_id, null, 'TP_XML','Mycomp','Process_850', '850', '4010', 1, xml_clob, null);
dbms_aq.enqueue(queue_name => 'IP_IN_QUEUE', enqueue_options => enqueue_options, message_properties => message_properties, payload => ipmsg, msgid => msg_handle);
commit;
END;
/
show errors;

Tuesday, December 8, 2015

BPEL preference values Overwritten after Server RESTART in Oracle SOA 11g

You can set default and current BPEL Preference values from the EM: 

1) Navigate to: Farm_soa_domain > weblogic domain > your_domain > soa_server1 > right click menu > system Mbean browser > oracle.soa.config > server:soa_server1 > SCAComposite > your project > SCAComposite.SCAComponent > processName 

2) Click the properties attribute, then goes to a tableview. You will see all properties you set in design time, and be able to edit them as well. 
To Persist the Changed Values of the Preferences within the EM (so that they are not reset with server restart): 

1) After you Apply the change to bpel.preference.<PREFERENCE_NAME>, click Return. 
2) Click Operations tab. 
3) Click on the Attribute Save. 
4) Click the Invoke button. 
5) Click Return.

Saturday, June 6, 2015

Sunday, November 17, 2013

How to purge Oracle AQ

How to purge Oracle AQ


Please execute following SQL query ==>
DECLARE
po_t dbms_aqadm.aq$_purge_options_t;
BEGIN
  DBMS_AQADM.PURGE_QUEUE_TABLE('username.PURCHASE_QUEUE_TABLE', NULL, PO_T);
END;

Sunday, September 8, 2013

How find duplicate lines in 2 files in Linux

Please use  following command in linux to find duplicate lines in file1.txt and in file2.txt. Duplicate lines will be stored in duplicate.txt
comm -12 <(sort file1.txt) <(sort file2.txt) > duplicate.txt

Friday, August 9, 2013

How to set BPEL Process Title in SOA Oracle 10g




Please follow following steps :
·         Define BPEL string variable "title"

<variable name="title" type="xsd:string"/>


 ·         Using Assign activity in BPEL, we can assign element value  from input EBM XML to this title variable as per our requirement. We can assign same  value  from input xml or modify it and then assign it to variable title .


 ·         Use Java Embedding activity from Jdeveloper. i.e bpel:exec


 Edit  the java embedding activity, set title for BPEL instance by using below command.


        setTitle((String) getVariableData("title"));










Sunday, July 28, 2013

How to use adapters in SOA cluster

File and FTP Adapters in BPEL Cluster
 
The following has to be done to enable inbound singleton adapters in BPEL Cluster environment:
  • Modify bpel.xml descriptor file of the BPEL process to include the following:
<activationAgent
...
<property name="clusterGroupId">adapterCluster</property>
</activationAgent>
  • Remember to use unique cluster names for adapters that you want to cluster.
    In other words, if you have 5 adapters in 5 processes or so then use 5 distinct names for clusterGroupId.

  • Use Metalink Doc ID 730515.1 for references

  • If you have a large BPEL process that is critical from performance perspective and therefore has to be run on more than one node, consider splitting it into two processes where the inbound adapter activation part would be in active-passive mode and would call the main process that would be run in active-active mode on all nodes.
 
File and FTP Adapters in ESB Cluster
[Not applicable as we are not using Adapters in ESB]
 
The following has to be done to enable inbound singleton adapters in BPEL Cluster Environment:
  • Modify .esbsvc file for the respective adapter to include the following:
<service name="myserviceX" ...>
  ...   <endpointProperties>
<property name="clusterGroupId" value="adapterCluster"/>
  </endpointProperties>
</service>
  • Remember to use unique cluster names

  • Use Metalink Doc ID 746108.1 for references
 
 
File Adapter share setting
[We are accessing everything from /gemdata/<<service folders>>. All the folders are mentioned in the excel sheet we sent]
The following has to be done to create File Adapter share setting:
  • Modify the following row in $ORACLE_HOME/bpel/system/services/config/pc.properties file on both servers:
oracle.tip.adapter.file.controldirpath=/you_share_mount
  • Copy modified file to the following directory:
$ORACLE_HOME/integration/esb/config/pc.properties
  • Use Metalink Doc ID 799706.1 for references
Use Distributed polling strategy for inbound DbAdapters
[Not applicable as we are not using Polling functionality of DBAdapter]
You have to set the option for dbadapters to work in a distributed environment by making the polling query to acquire locks.
  • To enable pessimistic locking, run through the wizard once to create an inbound polling query. In the Applications Navigator window, expand Application Sources, then TopLink, and click TopLink Mappings. In the Structure window, click the table name. In Diagram View, click the following tabs: TopLink Mappings, Queries, Named Queries, Options; then the Advanced… button, and then Pessimistic Locking and Acquire Locks.
  • Use Oracle® Application Server Adapters for Files, FTP, Databases, and Enterprise Messaging (B28994-02), section 4.5.6.10 for references
 
Custom Activation agents considerations
[Not applicable as we are not using Custom Activation Agents]
 
If you use custom BPEL activation agents similar to com.oracle.bpel.activation.SimpleActivationAgent defined in the bpel.xml descriptor as:
<activationAgent
className="com.oracle.bpel.activation.SimpleActivationAgent"
heartBeatInterval="3">
, you would have to consider using alternate ways of BPEL process activation.
These types of agents are not clusterable. Alternatively, you can use DbAdapters together with using of Oracle database functionality