Throwing a fault from an asynchronous bpel process

Hi,
can anyone please let me know how i can throw a fault to the calling client from an asynchronous bpel process?
(synchronous bpel uses the fault of the reply activity to do the same - i want a similar thing in a callback-invoke of an asynchronous process or any other way to do it if at all)
please let me know if it is possible becoz it was a requirement put forward by a customer and i just want to develop a proof of concept to the same.
regards,
pavan.

Hi,
I'm using BPEL process manager for calling a asynchronous web service,I can invoke the service from BPEL and the service is invoked correctly,but when I view the business process flow in BPEL Console my process is stopped at receive state and doesn't pass it.
Could anybody tell me if any thing should be set to receive a callback from an asynchronous web service to BPEL process?
Is it true that BPEL process receives a callback automatically (using a callback operation which I defined in my web service WSDL) on the same port type that normally receives the requested information, with an invoke activity?
So what could be wrong with my process or invoked web service that the BPEL process doesn't get any reply from my web service and remains in receive activity?
Thnx in advance,
Nasim

Similar Messages

  • How to get response from an asynchronous BPEL process in Java

    I'm experimenting with BPEL and doesn't seem to be able to get response from an asynchronous BPEL process. Here's the deal:
    I have a BPEL process that takes a string as input, and gives another string as output. This is a asyncronous process.
    I want to initiate this BPEL process as a web service so I generate a Webservice Proxy in JDeveloper 10g (10.1.3.0.4). The function to call the process is now called "initiate" and takes three arguments: the input string, a "org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType replyTo" and a
    "org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI messageID".
    HTTP-Analyzer shows that invoking the BPEL process with initiate("somestring", null, null) results in sending a SOAP message to the BPEL process, which returns a "202 Accepted". How do I get the response from the process? My intuition tells me that I have to use that second argument, that EnpointReferenceType thing. How do I use that?
    Another question: If a asynchronous BPEL process does not exists (so the endpoint does not exist) the Java proxy does not throw an error when runned. It does not even sends a message. It exits with status 0! (This happens for example when deploying a new version of a process and when the "old" version is undeployed). Calling a non-existing synchronous BPEL process, the Java proxy DOES throw an error.

    Clemens,
    That all sounds logical. But somehow it is still a mystery for me ... Somehow I don't see what should be done.
    To call the async BPEL process I have the following procedure:
    initiate(String input, org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType replyTo, org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI messageID)
    The first argument is the input for my BPEL process. The second is the address to a webservice that should handle the callback, right? The third is a messageID (makes sense, but why of the type AttributedURI?).
    Here lies my problem. It is not clear to me how these EndpointReferenceType & AttributedURI work. I can't find anything on the net about it. The AXIS examples as where mentioned earlier use other types (namely the "org.xmlsoap.schemas.ws.addressing.MessageID" and "org.xmlsoap.schemas.ws.addressing.ReplyTo") which are completely different.
    What I did so far:
    - I created an webservice proxy that listens on the onResult endpoint of the BPEL process.
    - I created an webservice proxy that calls the BPEL process through the initiate procedure, but it is not completely clear to me how to construct the EndPointreferenceType replyTo, and the MessageID. I did something like this:
    EndpointReferenceType replyTo = new EndpointReferenceType();
    // callback service running on local machine
    // This URI class is the java.net's version
    URI replyToURI = new URI("http://vaccinatie:8988/syncro-callback-context-root/stringconcatCallbackBindingPort");
    // This AttributedURI is the org.xmlsoap.schemas.ws._2003._03.addressing's version
    AttributedURI address = new AttributedURI();
    // the only public methos that made sense to me:
    address.set_value(replyToURI);
    replyTo.setAddress(address);
    // call the BPEL process
    myPort.initiate("test123", replyTo, address);
    But the above doesn't work (largely because I don't know what I'm doing here prob.:-) ) It does send the "test123" message, and the BPEL process does process it, but I don't seem to get the callback right.
    I hope this makes my problems somewhat clearer. I hope someone can help me, because I'm just a beginner in this whole "web service area" and seems to do something terribly wrong here, because it should be very simple. Thx.

  • HowTo get the callback from an asynchronous BPEL process to an ESB?

    Hi,
    I have deployed an asynchronous BPEL-process which is called from an ESB. So far no problems. But I want to receive the callboack fromt this BPEL process on the ESB, too.
    How is this possible?
    Note: I have created the BPEL-Process before I created the ESB. So I cannot add the ESB as a partner link in the BPEL Process. Or is this the only way?
    Message was edited by:
    user636134

    Hi,
    I have deployed an asynchronous BPEL-process which is called from an ESB. So far no problems. But I want to receive the callboack fromt this BPEL process on the ESB, too.
    How is this possible?
    Note: I have created the BPEL-Process before I created the ESB. So I cannot add the ESB as a partner link in the BPEL Process. Or is this the only way?
    Message was edited by:
    user636134

  • Invoking asynchronous BPEL process from java ui

    Hi,
    I am invoking an asynchronous BPEL process from java ui.
    I read somewhere that i can obtain an instance handler uing the lookupInstance() method of class Locator using the conversation id provided by the class NormalizedMessage.
    My code looks like this
    // Connect to Oracle BPEL server
    Locator locator = new Locator("default","bpel");
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    // Construct a normalized message and send to Oracle BPEL Process Manager
    NormalizedMessage nm = new NormalizedMessage();
    nm.addPart("payload", xml);
    // Initiate the BPEL process
    deliveryService.post("MyLoanFlow", "initiate", nm);
    //Obtain the instance handler
    IInstanceHandle handle = locator.lookupInstance(NormalizedMessage.CONVERSATION_ID);
    But this is giving the error - can not find any instance with conversation id 'conversationId'.
    Also, if i try to obtain a list of instance handles associated with a process , it does not contain the most recently created instance
    IBPELProcessHandle ph = locator.lookupProcess("MyLoanFlow");
    IInstanceHandle[] iHandler = ph.listInstances();
    out.println(iHandler.length + "<br>");
    if i invoke the process for the first time the output is 0.
    can you please help me. it is urgent.

    Hi Sudipto,
    Regarding your second question,
    deliveryService.post("MyLoanFlow", "initiate", nm);
    IBPELProcessHandle ph = locator.lookupProcess("MyLoanFlow");
    IInstanceHandle[] iHandler = ph.listInstances();
    out.println(iHandler.length + "<br>");
    ---- returns 0 ---
    This is because MyLoanFlow is an asynchronous process in your case. So the control is returned to your java block immediately after the request for a new instance is posted. And your second line of code(querying for the list of instances) is executed even before the instance is created on the server side. You can verify this in two ways:
    1. try creating an instance of a synchronous process using IDeliveryService.request - this will always result in the increment since the current thread is blocked till the new instance is created.
    2. for your case, you can try
    Thread.currentThread().sleep(500); - just allow the server some time for completing the instance before you query it for the list of instances..
    and wrt question 1,
    //Obtain the instance handler
    IInstanceHandle handle = locator.lookupInstance(NormalizedMessage.CONVERSATION_ID);
    But this is giving the error - can not find any instance with conversation id 'conversationId'.
    For setting the conversationId, you could do so by including the following inside your .bpel file
    <bpelx:exec name="test-setConversationId" language="java" version="1.4">
    <![CDATA[
    setConversationId("conversationId");
    ]]>
    </bpelx:exec>
    The code:
    IInstanceHandle ins = locator.lookupInstanceByConversationId(NormalizedMessage.CONVERSATION_ID);
    should fetch you the required instance in this case.
    HTH,
    Anuj

  • Unable to get callback from Asynchronous BPEL process to work (AXIS Client)

    Hello,
    I am calling an Asynchronous BPEL process from an AXIS client, and I am unable to get the callback functionality to work. The AXIS client code has been generated from WSDL2Java using the BPEL process' WSDL file.
    I CAN insert an invoke node in the BPEL process and invoke my Callback web service using that, but obviously that means the BPEL process is limited to only responding to one pre-determined client, which won't work.
    My questions:
    - How does the BPEL process know what endpoint to use to make the callback?
    - Do I need to modify the generated code to create a SOAP Envelope and invoke the process with the envelope, intead of the invokeOneWay call?
    - If I do need to create a SOAP Envelope with a replyto element, what is the structure of a typical BPEL envelope? Is there an example somewhere?
    I have looked at the examples in the interop directory, specifically the AXIS calling Async BPEL, but I would like to try to keep the client code as independent as possible (I don't really want to have a dependency on the OTN library).
    Any help would be greatly appreciated!!
    Thank you.
    -Ryan

    Please have a look at the Binding in the WSDL. Axis must provide the ReplyTo and
    MessageId information there. As far as I see, this must be done by an Axis-Handler,
    because the Binding-Part in not generated by WSDL2Java.
    I was able to generate the JavaClasses by using the "WSDL2Java -a" option, but
    I still do not see how to use them in a handler and how to register the handler.
    Maybe someone can give me a hint.

  • Asynchronous BPEL Process called from an empty BPEL process getting lost.

    Hi
    I have an empty BPEL process calling an asynchronous BPEL process. The empty process is triggered by a read file activity. It finishes successfully and even calls the asynchronous process. There is no error thrown but the called asynchronous process does not show up in the dashboard.
    When this asynchronous process is manually run from the console I get the page stating 'Cannot find the specified instance'.
    I am using Jdev 10.1.3.2 and SOA Suit 10.1.3.1.
    Any suggestion as to why this is happening and what is the remedy?
    Buddhadev.

    Check your log as soon as you find that the parent process has found its way into the console. More information on logging can be found here - http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28982/logging.htm
    Not quite sure why its so, but since 10.1.3, I've observed that the console simply doesn't show errored processes at times. So, checking the log can be a starting point in diagnosing the real issue.
    HTH
    Antony

  • How to call a Asynchronous bpel process from a PLSQL procedure?

    How to call a Asynchronous bpel process from a PLSQL procedure?

    Hi,
    You could do something smart and technical very spiffy with soap-stacks in the database and/or dbms_ws/dbms_http. But I allways find AQ with AQ-adapter the simplest. Let Pl/sql enqueue a message on an aq-queue and subscribe an aq-adapter process on it. That can call your async-bpel process. If you want to get answer back in pl/sql, let the aq-adapter process enqueue a response message on another queue or on the same queue with another consumer name. Give it a correlation-id that you provided in the payload of your request message. Your pl/sql process can then do a dequeue on that correlation-id. It will sit and wait until a message with that correlation id is enqueued on the queue.
    Regards,
    Martien

  • Retrieving Status/Results from Asynchronous BPEL Processes

    Hi,
    I'm trying to poll the results of an asynchronous BPEL process with Java RMI. I managed to get the state of my instance, but i could not get the results of the process.
    When I use the method getResult I only get an empty Object[]. (see my attached code)
    I'm working with the tutorial 101.HelloWorld process.
    How can I acess the results of this process by using RMI?
    Thank youf for replies.
    Marc
    Properties props = new java.util.Properties();
    java.net.URL url = ClassLoader.getSystemResource("context.properties");
    props.load(url.openStream());
    Locator locator = new Locator("default", "bpel", props);
    IInstanceHandle handle = locator.lookupInstance("myInstance");
    if (handle.getState() == IInstanceConstants.STATE_CLOSED_COMPLETED)
    System.err.println(handle.getResult());
    }

    Hi,
    I am having exactly the same problem.
    Was this bug ever solved ?
    Thanks,
    Claudio.

  • Error while invoking an asynchronous BPEL process

    Hi ,
    I am trying to call an asynchronous BPEL process through java client.
    Following is the code which I got from SOA bpel samples present in the following location
    <SOA_HOME>\bpel\samples\tutorials\102.InvokingProcesses\rmi\com\otn\samples\async
    The code fails while registering the callback
    String convId = GUIDGenerator.generateGUID();
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
    deliveryService.post("HelloWorld", "initiate", nm);
    // register the callback
    watchdog.registerAsyncCallback(convId, testAsyncHandler,
    locator.getDomainAuth());
    The error says java.lang.NoClassDefFoundError: org/collaxa/thirdparty/json/JSONString
    I tried to search for this in google. But it seems noone has got this error or maybe noone has used this at all.
    Maybe I am missing some jar file, but I am unable locate that.
    Can someone help me in this please.

    Hi,
    These sort of class not found errors come when you are running from a client which does not have all the jar files requried to invoke BPEL using the client API.
    org/collaxa/thirdparty/json/JSONString is orabpel-thirdparty.jar.
    The complete list of Jar files you would need in the classpath are:
    ejb.jar ($ORACLE_HOME/home/lib)
    oc4j-internal.jar ($ORACLE_HOME/home/lib)
    optic.jar ($ORACLE_HOME/opmn/lib)
    orabpel-common.jar ($ORACLE_HOME/bpel/lib)
    orabpel-thirdparty.jar ($ORACLE_HOME/bpel/lib)
    orabpel.jar ($ORACLE_HOME/bpel/lib)
    Hope this helps,
    Regards,
    Shanmu.
    http://www.prshanmu.com/articles/

  • Correlation in Asynchronous BPEL process

    I have thoroughly read docs & various blogs for this correlation concept and I am developed the bpel process without any compilation error. But when I execute, all the instances are waiting in receive activity with message *"Waiting for "processResponse" from "AsynchBPELProcess3.AsynchBPELProcess1.PartnerLink1". Asynchronous callback."*
    My scenario goes like this, I have three simple Asynchronous BPEL process with flow A --> B --> C i.e;
    step 1) client invokes process A with initial inputs
    step 2) process A does some assignment and invokes process B and then followed by a receive activity to receive response back directly from process C
    step 3) process B simply invokes process C after some assign activity
    step 4) process C do actual task for computation -- this is from where i am expecting output result at process A
    Done correlation at process A's recieveInput activity & in additionally added a receive activity to get response.
    Flows works as expected....everything if fine. But only at the time of returning the output result back to process A ..this waits for long time and after some time it becomes stale.
    Thanks.

    Yes you can achieve this. There are many ways to get this, it depends on your design. I didn't try the correlation sets.
    If i were you I would like to use the message header properties of the JMS queue. Set an MsgID for the request message and use the same MsgId to listen the response. You have to ask the partner to listen to your request message and store the KsgID and set the same MsgID to the header properties in response message.
    Let me know if you have any questions.
    Thanks
    Ramana.

  • Database polling adapter within an asynchronous BPEL process

    Hi,
    I have a requirement to poll a database table withing an asynchronous process. The reason I want to use a receive within an asynchronous BPEL is because the process needs to be notified many times thru polling. So might need many receive activities.
    I have developed a process as described below :-
    1. Created an asynchronous process.
    2. Created a Database adapter for polling a table. Logical delete strategy is being used.
    3. Have put a receive activity from the DB Adapter created.
    4. Created a correlation set consisting of a single property(String)
    5. Created a property alias to refer to
    a. the input string of the asynchronous process. (unique for this process)
    b. the input from the database adapter (unique for this process)
    I initiate this process from the console. Then I inserted a record the table with proper inputs.
    But the BPEL waits indefinitely at the receive activity.
    When I try to poll the table from an empty BPEL process, it works perfectly fine.
    Could someone please help me here.
    Thanks in advance
    Saptarishi

    Hi,
    Could someone pls answer this query.
    Regards,
    Saptarishi

  • Implement callback for an asynchronous BPEL process through Java

    Hi ,
    I am trying to implement a callback functionality for an asynchronous BPEL process through java.
    I found the code in the samples folder of SOA suite installation folder .
    <SOA_HOME>\bpel\samples\tutorials\102.InvokingProcesses\rmi\com\otn\samples\async.
    There is an AsyncInstanceWatchdog object which registers a callback object(in this case an object of AsyncCallbackImpl class) for a specific CONVERSATION_ID.
    String convId = GUIDGenerator.generateGUID();
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
    deliveryService.post(proc_name, "initiate", nm);
    // register the callback
    watchdog.registerAsyncCallback(convId, testAsyncHandler,
    locator.getDomainAuth());
    // start it
    watchdog.start();
    There is no problem till the last line. But once the BPEL process returns the control( does a callback), it throws the following error.
    May 25, 2010 3:36:06 PM oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    ORABPEL-02118
    Variant not found.
    The variant "output" has not been declared in the current scope. All variants must be declared in the scope before being accessed.
    Please check that the variant "output" is properly declared; otherwise there may be a misspelling in the name of the variant.
         at com.collaxa.cube.engine.core.Scope.getVariantRV(Scope.java:535)
         at com.collaxa.cube.engine.CubeEngine.getFieldValue(CubeEngine.java:2668)
    For your reference the variable output is declared in the definition of AsyncCallbackImpl (which implements the IAsyncInstanceCallback interface).
    There are 2 methods defined in the AsyncCallbackImpl class.
    public void onResult(Map pResultMessage) {
    System.out.println("called back! ");
    Iterator iTest = pResultMessage.keySet().iterator();
    while (iTest.hasNext()) {
    String key = (String)iTest.next();
    System.out.println(XMLHelper.elementToString((Element)pResultMessage.get(key)));
    public String getVariableName() {
    return "output";
    The variable name is same given in the sample code. And the BPEL process returns variable named output. So the name should not be a problem.
    Is it because of the scope of the variable.. If so, how do I change it.
    Any help would be appreciated.
    Edited by: saptarishi on May 25, 2010 4:24 PM
    Edited by: saptarishi on May 26, 2010 4:45 PM

    Solved it by some googling .... :)
    Here is the link:-
    [http://abhishek-soablog.blogspot.com/2008/09/orabpel-02118.html]
    or
    [http://beautifulwaste.blogspot.com/2008/04/calling-asynchronous-bpel-process.html]
    Both gives the same solution..
    In pre 10.1.3.3 release the default behaviour were to keep global variable information along with the instance information for completed BPEL processes.
    In 10.1.3.3 or later, this behaviour changed for performance reasons so that the default behaviour is now, not to keep any global variables for a BPEL process once the BPEL process has completed.
    You can configure this behaviour on a process level basis by using the parameter keepGlobalVariables in the bpel.xml file for the specific process:
    <BPELSuitcase>
    <BPELProcess src=".........." id="...........">
    <configurations>
    <property name="keepGlobalVariables">true</property>
    </configurations>
    </BPELProcess>
    </BPELSuitcase>
    Thanks
    saptarishi

  • Understanding asynchronous BPEL processes and threading

    Hi everybody,
    I have a question regarding asynchronous BPEL processes and threading.
    I have an asynchronous BPEL process which delivers a message (picked up from a JMS topic) to a repository (via for instance an ICAN server). This transaction must be time-sensitive, i.e. first-in is first-out.
    If I have several threads running concurrently I have no guarantee that the messages are delivered in the same order that they where generated. It seems that the suggested way around this problem is to use single-threading.
    So here's the part that I do not understand:
    An asynchronous request does not wait for a response. If I use single-threading then what happens to that single-thread if for some reason (for instance the ICAN server is not responding) the BPEL instance is dehydrated? Is the thread still allocated for waiting for the first response or does it go back and pick up the next thing on the topic? If the next thing on the topic is picked up then how can I be sure that the messages are delivered in the correct order? If the thread is still allocated to the single instance then does that not kindda go against the whole concept of an asynchronous process?
    I hope some one can explain this to me.
    Thank you in advance.
    Kind regards,
    Mathias
    PS. This question is an attempt of a different angle on another forum thread: Asynchronuos BPEL - how to get the order of messages right?

    Hi again,
    A quick follow up question:
    Is there any way to have several BPEL processes running on the same server with different settings for how many threads to use?
    It seems that the only way to set number of threads used by BPEL is to use the configuration in the BPEL console? This is an domain setting - which means that all processes deployed to the server is effected the same way?
    I am asking because I am facing a scenario where I need one BPEL process to read from a AQ queue (well actually a topic) with a single thread and another BPEL process - deployed to the same BPEL server - to read from the same AQ queue with multiple threads.
    Does anyone have any idea of how to do this? Can it be done?
    Any suggestions, hints or reference to any documentation would be very much appreciated.
    Thank you in advance,
    Aagaard

  • DBAdapter polling for new or changed records not issuing callback within an asynchronous BPEL process?

    Hi,
    I have a requirement to poll a database table withing an asynchronous process. The reason I want to use a receive within an asynchronous BPEL is because the process needs to be notified many times thru polling. So might need many receive activities.
    I have developed a process as described below :-
    1. Created an asynchronous process.
    2. Created a Database adapter for polling a table. Logical delete strategy is being used.
    3. Have put a receive activity from the DB Adapter created.
    4. Created a correlation set consisting of a single property(String)
    5. Created a property alias to refer to
    a. the input string of the asynchronous process. (unique for this process)
    b. the input from the database adapter (unique for this process)
    I initiate this process from the console. Then I inserted a record the table with proper inputs.
    But the BPEL waits indefinitely at the receive activity.
    When I try to poll the table from an empty BPEL process, it works perfectly fine.
    Regards
    Kabir

    Hi Kabir,
    Please refer the following sample for your usecase.
    Though Please be aware that one instance of BPEL process will correlate with only one message if you have one receive activity. Not all the messages tht DBAdapter polls.
    bpel-305-InboundCorrelationShows how to perform message correlation within BPEL
    Also Refer the following in Developer guide.
    http://docs.oracle.com/cd/E28280_01/dev.1111/e10224/bp_correlate.htm#CHDFHAAE
    If you want to keep polling and receiving the messages in the same BPEL process you might have to put the receive activity in a while loop construct. But as a design this is not a good design.
    Can you elaborate your requirement to understand better and suggest better solution.

  • Can an synchronous ESB process initiate an asynchronous BPEL process?

    I have a requirement to create a synchronous ESB service that initiates an aysnchronous BPEL process returning a success message to the requesting system.
    I can create an esb that receives a paylaod from the requesting system and returns a receipt message, I then created an asynchronous bpel process.
    Although I can initiate the asynchronous bpel process from the ESB I cannot work out how to send back the success message? The routing rules do not allow setting of outgoing messages unless you call a synchronous process?

    Can you make the BPEL process synchronous. Calling a asynchronous process breaks your synchronous message, because what happens if your asynchronous process takes longer that 1 minute. The synchronous process will timeout but the asynchronous process will complete.
    The previous note is correct you can use queues but all this will do is tell you that you posted correctly, you get the same result calling a web service. Asynchronous is fire and forget in a ESB world as it is stateless.
    cheers
    James

Maybe you are looking for

  • How to replace string

    Hi Experts, This is not jdeveloper question, but still i am asking, becoz i dont know other blogs......:( I want to replace one string, i am using StringUtils.replace(originalString,searchString,replacedString) everthing is working fine but if my ori

  • Attempting to do an initial Time Machine back

    Attempting to do an initial Time Machine back up on my wifes IMac.  Approximately 190GB of data.  The external HD is 500Gb cpacity. The first 70Gb goes pretty well, by the time it gets in to the 90Gb range it is only going at about 2Gb per hour and c

  • Missing adapter "templates" - am not able to create communication channel

    Hi guys! I need to create communication channel in the Directory, but I can't, because if I want to select channel type (soap, http, ...) I get screen with information: No objects found. What could be wrong? Thanx a lot for answer! Olian

  • Has anyone set up their roku xs player on the imac successfully? If so how to please?

    just bought a new imac 27 inch want to set up my roku player to run through it. Has anyone done this and is it easy? thanks

  • LO concept

    can anyone tell me what is the exact meaning of Transparent table and Cluster tables? Thanks, suresh.