BPEL Compensation Logic

Hello,
I am using Oracle SOA suite 10.1.3 and JDeveloper 10.1.3.1 for BPEL processes.
The process I created has a 'ParentScope' that has two child scopes inside a flow activity, 'BushScope' and 'BlairScope' having individual compensation handlers.
As per the process logic activities inside the 'BlairScope' takes longer time to complete, and 'BushScope' will throw an LadenException.
This excpetion is caught by ParentScope that invokes a default compensation activity.
'BlairScope' activities are canceled in the midway. As per my understanding of the BPEL4WS 1.1 spec, compensation handlers of either scopes "Bush or Blair' should not be initialized and should not be called.
Bus when I ran a process. BPEL console showed that compensation handlers of both scopes was called.
Please help me any way it is possible.... How should I handle such a compensation situation... Am I not handling it correctly?
Are there some simple examples for similar situations....
Thanks & Regards,
Govinda

Hello Clemens,
Following lines are from the spec BPELWS 1.1-
"A compensation handler for a scope is available for invocation only when the scope completes normally. Invoking a compensation handler that
has not been installed is equivalent to the empty activity (it is a no-op)"
Parent scope has a primary flow activity, which contains two concurrent invoke activites inside thier indivdual scopes, Bush and Blair scopes.
Before Blair scope successfully completes, 'I' have made sure that Bush will throw an exception. Now in this case, since niether of the child scopes have completed successfully and haven't sent COMPLETED SIGNALs to parent scope, I think thier compensation handlers should not be installed.
But in this trial example, cancellation webservice operation X, inside the compensation handler of the respective childs copes is called. So, the compensation handlers are getting installed even if the scopes have not completed successfully.
I have tried both implicit and explicit compensation in the BPEL.
Thanks & Regards,
Govinda

Similar Messages

  • Some question on CORE BPEL ENGINE

    Hello,
    I've read Chapter 4 and now I've some question:
    1-Clustering: What's you intend which expression "fail-over can be configured on the engine" and How? What Kind of clustering you realize (active-active, active-passive,...)?
    2-I think that I don't exactly understand what you intend with "BPEL Compensating Transaction Model" could you give me more information about this?
    thank you guys!
    Andrea

    1- I just completed a draft of a tech note on High Availability that I can share with you that explains the clustering model in detail. At a very high level, the BPEL Server is completely stateless and reliable, including a built-in recovery service that enables failover in case of failures. You don't need to cluster the app-server to be able to cluster BPEL servers (for either high availability or scalability).
    2 - BPEL provides support for compensating transactions, which is an alternative transaction model when XA-style, ACID transactions can not be used (either due to the long-running nature of a "transaction" or the inclusion of services which don't support XA/JTA style transactions. We have code examples available for this and slides from our training course that discuss it.
    Send me an email if you would like access to either of these documents. I'll also try to publish them to OTN in the next few days as tech notes, but in the meantime, I'm happy to share the information directly with any individuals who want it.
    Dave
    David Shaffer
    Product Mgr, Oracle BPEL Process Manager
    [email protected]
    W: 650.506.1729
    http://otn.oracle.com/bpel

  • Renaming an already existing BPEL Process

    Hi,
    We have an already existing Bpel Process which is already deployed in the Default Domain via the Bpel Console.
    Now we want to deploy this process in another domain on the same Bpel Server but we want to change the Name of the bpel process ..( change the name of the project)...
    Could someone please let us know whether this is possible to achieve and what all steps need to be taken..because there be references to this bpel process name in the Namespace and XSD's as well and also might be linked to names for the variables used in the Bpel process logic..
    we want to change the name of the bpel process ..could someone please help us with this as soon as possible
    we are on the version :10.1.3.3.1
    Thanks

    Hi,
    Thanks for your reply..but am just curious to know as to how does it work internally..
    This is how my bpel.xml looks after changing the ID value to ProcessName2 as you mentioned
    <BPELSuitcase>
    <BPELProcess id="ProcessName2" src="ProcessName1.bpel">
    <partnerLinkBindings>
    <partnerLinkBinding name="client">
    <property name="wsdlLocation">ProcessName1.wsdl</property>
    </partnerLinkBinding>
    </partnerLinkBindings>
    </BPELProcess>
    </BPELSuitcase>
    Now here it still references the wsdl with the name ProcessName1.wsdl but when i see on the Bpel Console the WSDL location has changed to like this :
    http://server_name:port/orabpel/domain_name/ProcessName2/1.0/ProcessName2?wsdl
    and the end point location has changed to :
    http://server_name:port/orabpel/domain_name/ProcessName2/1.0
    Now in the bpel.xml it is still referencing the wsdl with old name but while deploying from the jdev to the bpel server it has changed to the new wsdl location and end point..
    thanks

  • Problems using compensation handler in soa11g

    Dear All,
    I am working on soa 11.1.1.3 ,
    i am having problems using compensate activity and also compensation handler inside a scope.
    By what i have read on the net,i think its used to roll back a completed process.
    In my case, i am making a call from process 1 to process 2 to process 3 and if any one process fails,say process 3,then i want to rollback process 3.
    i have put all the 3 process inside different scopes.
    Now after the completion of process 3 i used a throw activity to throw an error just to check whether compensate rollsback process 3 or not(roll back only 3 because process 3 is in a different scope and i am using compensate inside the catchall activity of process 3).But what i found was in the audit trail of the instance, process 3 status is completed and it also show's a fault has occured.
    what i thought was that process3 would have been completely roll backed and the audit trail would have showed information only till process 2.
    am i goin wrong some where or have i interpreted it in the wrong way!!!
    Any suggestion's are most welcome!!!
    Regards
    Ajay.v

    Hi,
    When you use compensate activity you can only rollback successfully executed scopes and u need to write the compensation logic in the compensate handler of a scope.

  • Database adapter and commit

    I am trying to use BPEL process manager to read many items from a database table, transform them and then write the transformed records to another table. I have found the database adapter demo very useful. However, I would like to commit the transformed data only when all the data has been succesfully transformed. Can anyone think of a way of doing this? I am new to BPEL and JCA, perhaps the wsdl for the database adapter could be changed to expose a commit method?
    Thanks in advance for any advice.
    Neil.

    Hi Neil,
    at the moment it is not possible to have the entire bpel process from db adapter receive to db adapter invoke inside a single jta/global transaction context. We are working on some ideas for next the release.
    The best thing for now is to add exception handling to your business process and apply some compensation logic for the individual records which fail. I.e. if using the LogicalDeletePollingStrategy you could set the 'deleted' flag back to 'errored' for rows which are found to be invalid in the transform step and have a separate business process to deal with these.
    You could also try a large maxRaiseSize setting. That way if you read 100 rows they will be raised as a single xml document. If the transform fails then no rows will be written to the target database. However the commit will still occur on the source database.
    Finally, you could use a non-destructive polling strategy like the SequencingPollingStrategy or LogicalDeletePollingStrategy and a large maxRaiseSize. Your business process could look like this:
    receive (non-destructive destroy)
    transform
    merge all rows - target db
    delete all rows -source db
    If the 'merge' operation is jta enabled then it will be rolled back if either the transform or the delete fails.
    This above idea is like a two stage polling strategy. First the rows are marked as being processed by the receive, but only when they arrive at the target db are they marked a final time as being completed or deleted completely.
    Let us know if you need help implementing these ideas. To jta enable the merge see the recent thread 'oc4j-ra and data-sources.xml'.
    Thanks
    Steve

  • Database adapter -  commit transactions

    Hello everybody.
    Is it possible with the BPEL Process Manager (Databas Adapter) to handle some f.e. INSERTS on a database (also with more then one adapter) only with on database connection and commit all INSERTS only at the end of the process?
    So it is important that I use only one db-connection. I don't want to open a db-connection for every db-adapter I want to open (to do an Insert or sth else) .
    Thx a lot

    Hi Neil,
    at the moment it is not possible to have the entire bpel process from db adapter receive to db adapter invoke inside a single jta/global transaction context. We are working on some ideas for next the release.
    The best thing for now is to add exception handling to your business process and apply some compensation logic for the individual records which fail. I.e. if using the LogicalDeletePollingStrategy you could set the 'deleted' flag back to 'errored' for rows which are found to be invalid in the transform step and have a separate business process to deal with these.
    You could also try a large maxRaiseSize setting. That way if you read 100 rows they will be raised as a single xml document. If the transform fails then no rows will be written to the target database. However the commit will still occur on the source database.
    Finally, you could use a non-destructive polling strategy like the SequencingPollingStrategy or LogicalDeletePollingStrategy and a large maxRaiseSize. Your business process could look like this:
    receive (non-destructive destroy)
    transform
    merge all rows - target db
    delete all rows -source db
    If the 'merge' operation is jta enabled then it will be rolled back if either the transform or the delete fails.
    This above idea is like a two stage polling strategy. First the rows are marked as being processed by the receive, but only when they arrive at the target db are they marked a final time as being completed or deleted completely.
    Let us know if you need help implementing these ideas. To jta enable the merge see the recent thread 'oc4j-ra and data-sources.xml'.
    Thanks
    Steve

  • Two Phase Commit on Slow Network

    Can I implement two phase commit transaction using Windows 2000 Professional's Dial-Up Connection ? Where would I find information on this ? I connected two Windows 2000 Prof. PCs using Dial-Up Connection on Telephone line. Now if I try to ping service on other PC using TNSPING it gives me connection timed out, how should I tackle this issue ?

    Hi Ioakim
    Performing an atomic transaction(ACID) that spans a source system, BizTalk and then a different destination system is not possible. This is due to the nature of distributed transactions - it may not be practical to hold locks on resources(needed for atomic
    transactions) that are spread across different networks. Given that there is no guarantee that the resources may be released in a reasonable amount of time, transactions in BizTalk can only be scoped to and from the BizTalk MessageBoxDb. Or in other words,
    you can read a record to BizTalk transactionally and on the send side, send a message from BizTalk transactionally.
    However, you can simulate/fake atomic transaction characteristics(although tricky) using compensation logic within BizTalk orchestrations. So, lets say you read+delete a record from SystemA into BizTalk, and that record has to be updated in SystemB.
    If for some reason the insert to SystemB fails, you would have to write custom logic in a compensation block that then performs the reverse operation in SystemA - i.e., it inserts back the record in SystemA in this case. So, using compensating actions, it
    is possible to ensure that all the systems involved are transactionally consistent at the end of the day.
    There's an article from C.Young that discusses this in some detail-
    http://geekswithblogs.net/cyoung/archive/2006/12/06/100424.aspx
    Thanks
    Arindam

  • Database between two server (sun and sql server)

    I have two server. The first used sun solaris with sybase database and the other used windows sql 2000 server without database. What should i do if i put my web homepage at windows based server and my database at sun-solaris-sybase server. Please help..

    Hi Ioakim
    Performing an atomic transaction(ACID) that spans a source system, BizTalk and then a different destination system is not possible. This is due to the nature of distributed transactions - it may not be practical to hold locks on resources(needed for atomic
    transactions) that are spread across different networks. Given that there is no guarantee that the resources may be released in a reasonable amount of time, transactions in BizTalk can only be scoped to and from the BizTalk MessageBoxDb. Or in other words,
    you can read a record to BizTalk transactionally and on the send side, send a message from BizTalk transactionally.
    However, you can simulate/fake atomic transaction characteristics(although tricky) using compensation logic within BizTalk orchestrations. So, lets say you read+delete a record from SystemA into BizTalk, and that record has to be updated in SystemB.
    If for some reason the insert to SystemB fails, you would have to write custom logic in a compensation block that then performs the reverse operation in SystemA - i.e., it inserts back the record in SystemA in this case. So, using compensating actions, it
    is possible to ensure that all the systems involved are transactionally consistent at the end of the day.
    There's an article from C.Young that discusses this in some detail-
    http://geekswithblogs.net/cyoung/archive/2006/12/06/100424.aspx
    Thanks
    Arindam

  • Loop through Array structure - using xpath

    Hello,
    My BPEL process logic is as follows:
    a. Extract data into variable - receiveMessageInputVariable
    The variable 'receiveMessageInputVariable' in turn has data in array structure. (set of items)
    b. Transform the data to target structure
    c. Call target partner link to store extracted data into varaible 'ServiceInputVariable'
    The variable 'ServiceInputVariable' structure is similar to 'receiveMessageInputVariable'
    In the BPEL process 'at process' level - I have catch-all exception handler - which must send the list of 'items' which failed during a BPEL instance.
    i. If my email body has the following code as below:
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
    It successfully fetches only the first item_number record of the array structure. But does not fetch the other records in the array.
    ii. Similarly, I wish to print all the items (as received) to be available in the email body in the following pattern:
    <%"Record One-"%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[1]/ITEM_NUMBER')%>
    <%"<br/>"%>
    <%"Record Two-"%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[2]/ITEM_NUMBER')%>
    <%"Record Nth-"%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[N]/ITEM_NUMBER')%>
    Please suggest a suitable syntax in my email body - which can loop through all itemline_item array and print all the item_numbers.
    (pseudo code below)
    for i in 1 .. ora:countNodes(bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER'))
    loop
    <%"Item Number-"%><%bpws:getVariableData('i')%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
    end loop;
    Thanks,
    Santhosh

    Hi Santhosh
    Try with the following approach. It may work for you
    1. Create one XSD, for the HTML content
    <xsd:element name="HTML">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}">
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    2. Create one XSL, may be you have to do this manually, as JDev will not support HTML transformations. This XSL will map your input XML to an HTML format.
    3. Create one variable in BPEL of type in the above XSD
    4. Use assign activity to assign the XSL transformation to the variable defined in Step#3
    <from expression="ora:processXSLT('HTMLTransformation.xsl',bpws:getVariableData('Variable_Input',INPUT_TYPE'))"/>
    <to variable="invokeWriteHTMLService_Input" part="HTML" query="/ns6:HTML/ns6:C1"/>
    5. Copy the variable to the email body variable
    <copy>
    <from expression="bpws:getVariableData('invokeWriteHTMLService_Input','HTML','/ns6:HTML/ns6:C1')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns8:Content/ns8:ContentBody"/>
    </copy>
    Basically, the above approach converts your input to a string value whose content is a complete HTML, and you will use only one value to assign to the email body.
    Note: Please change the Variable names/XPATH Expressions/XSL file name/element names etc according to your BPEL
    Hope this helps you
    Regards
    Ayon

  • What are the major benefits of moving business logic to BPEL?

    If our logic is basically unique to every situation (i.e. customer/deployment) is there an advantage of putting it in BPEL?

    When you put the steps 1 to 8 in a form. It becomes a big logic built using different small logics.
    Your logic wont be reusable by other systems.
    When put them in a BPEL process, It becomes a structured business process.
    It becomes reusable and it can be invoked by any application (Both internal and external) built on any technology.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Using Logical Directory property in Assign File Adapter BPEL

    Hi,
    I wanted to use The Logical Directory which I created while making File Adapter in a BPEL process in 11g, in an assign activity.
    How it can be done?
    Thanks in advance
    Sharat

    I have already created a binding property for Logical Directory in Composite.xml. The thing is I want to set it through em, and check inside BPEL whether it is null or not. Only after that the File Adapter should be invoked.
    I wanted to avoid exception if the binding property is not set by the user.
    The solution lies in the word "exception" itself, just put the "invoke" activity inside a scope and on that scope attach a catch activity with "Binding Exception". If the file adapter is not able to find the file path, it will raise the excetption and "catch" will catch and inside catch I am able to put any activity which can end the process gracefully.
    Sharat

  • BPEL Process with complex Business logic

    Hi,
    So far my knowledge,complex business logic can be implemented by different way in bpel process.
    1. Business rule
    2. ejb with java callout
    3.ADF BC as servcie
    Can anybody please suggest which approach do I need to follow,what are the pros and cons of each one,and best practices to use when and where?
    Thanx in advance.-Aswini

    Hi
    In addition to what Naresh already mentioned, you can consider these points also.
    1. If your process is complex, see if some part of the process can be common across and it can run by itself. Then you can use SubProcess concepts also. Say for example, if process involves credit card processing, it can be in a sub-process and you can call it in the main process. Like that any common approval flows can be put in a separate sub-process.
    2. I would discourage using Java invocations if possible as they have some limitations and you can use reasonable amout of code in invoking java code within the bpel process. If you have lots of validations to do on a bpel process, you can consider using CallBackHandlers and do the validation on a task assignment, submission or any task action in general.
    3. Business Rules can be used to control the actual flow of the process itself. Based on busiiness rule, you can decide if a set of tasks needs to be included or not in the approval flow. This is in addtion to the actual data that controls the business rules, that can be changed dynamically without the code change to core bpel process.
    Which version of SOA are you using or plan to use. I would recommend the latest version SOA 11.5 + Feature Pack applied.

  • BPEL File Adapter Logical Path Issue

    I am trying to write the BPEL Error Messages using a file adapter. But I could not parameterize the logical directory. I need a solution of changing it in the BPEL console after deploying it
    I am Invoking a FileAdapter Web service using logical direcotry, in the FileService partnerlink I set the file_loc property with type"LogicalDirectory" and set the value to " D:/BPEL_Errors" etc. This is working fine but except in the BPEL Console I could not edit it, All the Partner Link properties seems to be read only and not editable. I tried creating a user property for the BPEL process which can be editable but How do I refer this user property in partner link since I cannot use XPATH expression there?.
    I guess this should be a very generic problem all I am looking for is parameterizing the File Location. Any Ideas?
    Thanks,
    Chitra

    Thanks James. It would be really nice if the first option works, do you have any idea why its not editable. I am having the following in bpel.xml
    <partnerLinkBinding name="FileService">
    <property name="wsdlLocation">FileService.wsdl</property>
    <property name="BPEL_LOG">D:\JDeveloper\jdev\mywork\BPEL_LOG</property>
    When I deploy the above, In the console I see BPEL_LOG as non editable field. Is am doing anything wrong?.
    Regarding the second option , I guess you are talking about modifying the Outbound message header by adding a new property called directory, as mentioned in the following link.
    http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_file.htm#CACFFAHI
    Since there are many bpel processes which use the fileservice, I need to edit the fileAdapterOutboundHeader.wsdl in multiple places. Please let me know whether I can make the first option to work

  • Compensation in Oracle BPEL not according to spec

    Hello,
    while playing around with the oracle BPEL engine and compensation I figured out, that the Oracle BPEL engine doesn't behave according to the BPEL standard as far as compensations are concerned:
    The spec (http://www.ibm.com/developerworks/library/specification/ws-bpel/, S. 30) says:
    "The <compensate> construct is used to invoke compensation on an inner scope that has
    already completed normally.This construct can be invoked only from within a fault handler
    or another compensation handler."
    In fact - the BPEL Engine does invoke the scopes which have not finished as well. It does not compensate the scopes which have not been activated yet.
    I assembled a running example in which I have 4 scopes: Error, Waiting, Running and Finished. The example is completely standalone - thus does not require any further webservices.
    The Error-Scope triggers the compensation by throwing an exception. At that time another scope is still running and one has already finished. As your will see, the compensate after the fault invokes the compensate of the Scopes Error,Running and Finished. I had expected - that according to the specs - it should only had invoked the Finished scope.
    This is what the ActiveEndpoints engine does. I compiled the sample example for ActiveEndpoint 3.1 and included it in the zip file.
    The example can be downloaded at:
    http://achrist.net/~a.christ/download/CompensateTest.zip
    Is this behavior intended - and when - why is it not mentioned to be a derivation from the BPEL spec ?
    Thanks in advance,
    André

    Hello!
    Is there any news on this topic? I acutally experienced the same behaviour today.
    My process has two service calls in parallel, each of the calls is surrounded by its own scope with compensation handlers. In the all surrounding scope I catch all faults and call both compensation handlers. The one for the faulted service call should behave like <empty>, but it doesn't and produces the next fault, as the system is unavailable.
    Even worse, if the "faster" thread throws the fault the compensation for the "slower" thread is started, even though the service call in the "slower" thread hasn't even started.
    I can't believe this is intended behaviour!!!
    Am I missing something? Are there any workarounds? Can you please comment on this.
    Thanks,
    Markus

  • How to establish WS Security for BPEL processes running on Web Logic

    We are running SOA Suite 10.1.3.4 on Web Logic Server 9.2.
    I have built BPEL processes and now want to implement WS Security for them, "Wssp1.2-Wss1.0-UsernameToken-Plain-X509-Basic256.xml" in particular. Have been researching but could not find any document for a Web Logic scenario; can any of you please give me some directions or blogs which might be helpul.
    Appreciate your help in advance.
    Thanks!

    Hi
    Check the Link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/526bd490-0201-0010-038e-d3ff7eb1d16e
    Regards ,
    Venkat

Maybe you are looking for

  • Single Airport Express with Multiple iTunes Clients ?

    Is it possible for an Airport Express to be controlled by more than one copy of iTunes or does it have to be a unique pairing? I have an office of Mac users who want to be able to play from their desktop iTunes libraries to an office stereo connected

  • Period End Closing in sap b1 8.8

    Hi All Expert, Pls. Provide me step of period end Closing. How we can execute previous year period (i.e 2010) in SAP business one.inform me with details. Thanks

  • Initializing delta issue in IDES Sandbox

    Hi, I am new to SAP BI and trying to initialize delta  in IDES Sandbox from ODS/DSO to InfoCube but having an error: init. select. for field name currently running in request REQU_CWJKPB7ZS3LA8H7I8LOHQAXMH. I've successfully loaded the data to ODS bu

  • Ship-to party vs. delivery address

    Dear All, We have the following conditions sold-to party - Italy ship-to party - UK (distribution) We should deliver our FGs into UK, but they (UK) requested us to deliver the goods directly to end users into Austria. What shall we do with SO? Shall

  • Creation of an application which displays four Road map steps in vertical

    Hi all, I need to create an application which contains four Road map steps for example step1 -> step2 -> step3 -> step4 , but in vertical order. can i know the perfect UI elements which are req to be used for the creation. thanks in advance.......