Catching and processing exceptions in a BPM

All,
I have several processing blocks in my BPM and each has its own exception defined. I'm checking exceptions in my blocks but would like to react differently for each of them.
How can understand the values in an exception. I would like to send different sets of replies by exception data. How do I analysis what's stored in exception.
I tried creating a simple string and assigned text via container operation. However, I cannot assign this to an interface (abs). So I'm stuck.
thanks for all your replies!

Hi Parimala,
I had a similar requirement and let me write to you an option which i did
and an option which could be used in when we upgrade to >SP15 (we are on Sp14 now).
- I send out one message for all the excpetions, however, in the BPM send step i enter a value in the send context, which can be check in the configuration by checking the value for the context object "Process Step", and based on the different cases, i use different mapping programs(the process step is not available inside graphical mapping) and sends out different messages.
- from SP15 onwards, there is a property in the send step in addition to the Send Context, which is a "Conversation ID". I can set these with different values for the different send steps based on where the exception occured...This varaible is accessible within the mapping program(this is part of the mapping runtime values like sender, receiver etc..)...and the string can be set accordingly..
What SP version are you On??
Thanks,
Renjith

Similar Messages

  • How to localize HumanTask names and process names of oracle BPM process ?

    Anybody known how to localize HumanTask names and process names of oracle BPM process ?

    Oracle Apex is an API, if that helps you understand / visualize. You do not start Apex process nor stop it.
    When an Apex session starts it starts calling the API.
    You can however start / stop the listener. It may be OHS, ApexListener and the J2EE container running it, OC4J or any other "server" that you are using.
    The built-in EPG is something like an API again, you cannot start / stop it but you can disable/enable it with DBMS_XDB.SETHTTPPORT API.
    Regards,

  • Java101: Catching and Handling Exceptions question

    Dear all,
    I am learning java from http://java.sun.com/docs/books/tutorial/essential/exceptions/putItTogether.html
    However, I think the code in ListOfNumbers may have some problem, I put void in front of the function, but still have error. Could you please tell me any problem in the program?
    thanks
    import java.util.Vector;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.*;
    public class Main {
        private Vector vector;
        private int SIZE = 10;
        public static void main(String[] args) throws IOException {
        public ListOfNumbers () {
            vector = new Vector(SIZE);
            for (int i = 0; i < SIZE; i++) {
                vector.addElement(new Integer(i));
        public void writeList() {
            PrintWriter out = new PrintWriter(
                                new FileWriter("OutFile.txt"));
            for (int i = 0; i < SIZE; i++) {
                out.println("Value at: " + i + " = " +
                             vector.elementAt(i));
            out.close();
            FileInputStream in = null;
            FileOutputStream out = null;
                in = new FileInputStream("xanadu.txt");
                out = new FileOutputStream("outagain.txt");
                int c;
                while ((c = in.read()) != -1) {
                    out.write(c);
        public void writeList() {
        PrintWriter out = null;
        try {
            System.out.println("Entering try statement");
            out = new PrintWriter(
                           new FileWriter("OutFile.txt"));
                for (int i = 0; i < 5; i++)
                    out.println("Value at: " + i + " = "
                                 + vector.elementAt(i));
        } catch (ArrayIndexOutOfBoundsException e) {
             System.err.println("Caught "
                         + "ArrayIndexOutOfBoundsException: "
                         +   e.getMessage());
        } catch (IOException e) {
             System.err.println("Caught IOException: "
                                 +  e.getMessage());
        } finally {
             if (out != null) {
                 System.out.println("Closing PrintWriter");
                 out.close();
             else {
                 System.out.println("PrintWriter not open");
    }

    I have also post the error message here, I change the name of the file and the class name. I think I can not handle the error message #1 and #2. Please help me! Thanks
    * Main.java
    * Created on June 19, 2007, 10:54 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package bytestreams01;
    * @author Marco
    import java.util.Vector;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.*;
    public class Main {
        private Vector vector;
        private int SIZE = 10;
        public static void ListOfNumbers(String[] args) throws IOException {
        public ListOfNumbers () {
            vector = new Vector(SIZE);
            for (int i = 0; i < SIZE; i++) {
                vector.addElement(new Integer(i));
            FileInputStream in = null;
            FileOutputStream out = null;
                in = new FileInputStream("xanadu.txt");
                out = new FileOutputStream("outagain.txt");
                int c;
                while ((c = in.read()) != -1) {
                    out.write(c);
        public void writeList() {
        PrintWriter out = null;
        try {
            System.out.println("Entering try statement");
            out = new PrintWriter(
                           new FileWriter("OutFile.txt"));
                for (int i = 0; i < 5; i++)
                    out.println("Value at: " + i + " = "
                                 + vector.elementAt(i));
        } catch (ArrayIndexOutOfBoundsException e) {
             System.err.println("Caught "
                         + "ArrayIndexOutOfBoundsException: "
                         +   e.getMessage());
        } catch (IOException e) {
             System.err.println("Caught IOException: "
                                 +  e.getMessage());
        } finally {
             if (out != null) {
                 System.out.println("Closing PrintWriter");
                 out.close();
             else {
                 System.out.println("PrintWriter not open");
    }error message
    init:
    deps-jar:
    Compiling 1 source file to C:\Users\Marco\bytestreams01\build\classes
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:29: illegal start of expression
    public ListOfNumbers () {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:29: invalid method declaration; return type required
    public ListOfNumbers () {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:41: <identifier> expected
    in = new FileInputStream("xanadu.txt");
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:42: <identifier> expected
    out = new FileOutputStream("outagain.txt");
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:45: illegal start of type
    while ((c = in.read()) != -1) {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:45: <identifier> expected
    while ((c = in.read()) != -1) {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:45: ';' expected
    while ((c = in.read()) != -1) {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:50: class, interface, or enum expected
    public void writeList() {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:53: class, interface, or enum expected
    try {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:55: class, interface, or enum expected
    out = new PrintWriter(
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:57: class, interface, or enum expected
    for (int i = 0; i < 5; i++)
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:57: class, interface, or enum expected
    for (int i = 0; i < 5; i++)
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:57: class, interface, or enum expected
    for (int i = 0; i < 5; i++)
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:61: class, interface, or enum expected
    } catch (ArrayIndexOutOfBoundsException e) {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:66: class, interface, or enum expected
    } catch (IOException e) {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:70: class, interface, or enum expected
    } finally {
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:73: class, interface, or enum expected
    out.close();
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:75: class, interface, or enum expected
    C:\Users\Marco\bytestreams01\src\bytestreams01\ListOfNumbers.java:78: class, interface, or enum expected
    19 errors
    BUILD FAILED (total time: 0 seconds)

  • How to catch and handle soap foult in a BPM process?

    Hi,
    I have a BPM process which calls a webservice in one of its activities. The webservice throws an exception so the response will contain a soap fault element. I defined exception handlers to handle the error but none of the exception handlers are called. How can I catch and handle these types of error?
    The log contains this:
    A component failed while executing activity '/Process1#Default-1.0/Automatic' (BP-method Automatic) over instance '/Process1#Default-1.0/3/0'.
    Details:
    The method 'CIL_automatic' from class 'BEA_Systems__Inc__.Process1.Default_1_0.Instance' could not be successfully executed.
    Caused by: <?xml version="1.0" encoding="UTF-8" ?>
    <MyException faultString="" faultCode="{http://schemas.xmlsoap.org/soap/envelope/}Server"/>
    fuego.lang.ComponentExecutionException: The method 'CIL_automatic' from class 'BEA_Systems__Inc__.Process1.Default_1_0.Instance' could not be successfully executed.
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:498)
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:251)
         at fuego.fengine.FEEngineExecutionContext.invokeMethodAsCil(FEEngineExecutionContext.java:214)
         at fuego.server.execution.EngineExecutionContext.runCil(EngineExecutionContext.java:1068)
         at fuego.server.execution.TaskExecution.invoke(TaskExecution.java:389)
         at fuego.server.execution.TaskExecution.executeCIL(TaskExecution.java:481)
         at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:655)
         at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:616)
         at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:152)
         at fuego.server.execution.activities.XAutomatic.execute(XAutomatic.java:60)
         at fuego.metadata.Activity.execute(Activity.java:1022)
         at fuego.server.execution.ToDoItemAutomatic.execute(ToDoItemAutomatic.java:35)
         at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:290)
         at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:462)
         at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:540)
         at fuego.transaction.TransactionAction.start(TransactionAction.java:213)
         at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:117)
         at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:57)
         at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42)
         at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:264)
         at fuego.server.execution.ToDoItem.run(ToDoItem.java:531)
         at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:754)
         at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:734)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:140)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:132)
         at fuego.fengine.ToDoQueueThread$PrincipalWrapper.processBatch(ToDoQueueThread.java:432)
         at fuego.component.ExecutionThread.work(ExecutionThread.java:818)
         at fuego.component.ExecutionThread.run(ExecutionThread.java:397)
    Caused by: fuego.soaptype.SoapExecutionException: <?xml version="1.0" encoding="UTF-8" ?>
    <MyException faultString="" faultCode="{http://schemas.xmlsoap.org/soap/envelope/}Server"/>
         at fuego.soaptype.SoapCall.processRemoteException(SoapCall.java:531)
         at fuego.soaptype.SoapCall.invoke(SoapCall.java:292)
         at fuego.soaptype.SoapObject.invoke(SoapObject.java:272)
         at fuego.lang.Invokeable.invokeImpl(Invokeable.java:220)
         at fuego.lang.Invokeable.invoke(Invokeable.java:161)
         at BEA_Systems__Inc__.Process1.Default_1_0.Instance.CIL_automatic(Instance.java:265)
         at BEA_Systems__Inc__.Process1.Default_1_0.Instance.CIL_automatic(Instance.java:281)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:491)
         ... 27 more
    Thanks,
    fifty

    Hi fifty,
    Did you get a solution to the above problem you have mentioned? I have a similar issue i am trying to fix.
    I have a webservice call in a process activity and if the call does not work i get a soap fault and the fuego.lang.ComponentExecutionException . My process requires that i catch the exception infact any kind of exceptions that occur on that call and perform another activity in the process.
    I have defined an exception handler at the activity level for java.lang.Exception and java.lang.RunTimeException.
    i don't see anything in the catalog which would handle the SOAP fault OR the componentexception.

  • Acheive both Options: BPM restart and Raise Exception.

    Hi All,
    I have a requirement in my current project in BPM design.
    In case of any application errors or system errors the BPM process should fail at the step and the exception hadler should catch the exception and information should reach the end user as an Alert.
    But I am facing problem in acheving both the objectives.
    1.If  an exception is occured an alert will be triggered using the control step and the BPM will be successfull and will not be available for restart.
    2.If I am deliberately not handling the exceptions inside the BPM ,it will fail and the BPM will be avaialble for the restart but this time alert will not be triggered.
    Can any one suggest me an alternaive way out for this requirement?
    Thanks & Regards,
    Sunil.

    Hi Sunil
    n case of any application errors or system errors the BPM process should fail at the step and the exception hadler should catch the exception and information should reach the end user as an Alert.
    But I am facing problem in acheving both the objectives.
    1.If an exception is occured an alert will be triggered using the control step and the BPM will be successfull and will not be available for restart.
    2.If I am deliberately not handling the exceptions inside the BPM ,it will fail and the BPM will be avaialble for the restart but this time alert will not be triggered.
    I have faced similar requirement before.
    I don't know this will help or not.
    What we have done is when we get exception, the generated alert message was passed to a data type that do an RFC call to PI system. Which in turn generated the alert messages as email to the concerned people and generate a response message that creates dummy message. Which fails the BPM. We came to know the error received in so that it can be rectified or restarted. This fulfilled my requirement.
    We used the similar method to get rid of message queue when bulk messages entered and restarted automatically
    Thanks
    Gaurav

  • Exception handling in BPM and ABAP mapping

    Hello all,
    We have a BPM with this structure:
    . REC (receiver)
    . <begin BLOCK1>
      . TRANSFORMATION1 (Abap Mapping)
      . <begin EXCEPT> (exception branch)
        . CONTROL (Cancel Process)
    . <end EXCEPT>
    . <end BLOCK1>
    The same exception is assigned to the block; to the mapping and to exception branch.
    The problem is that, when in the Abap Mapping the exception CX_MAPPING_FAULT is raised, the exception branch seems to be ignored and so, the BPM doesn't finish.
    This problem only occurs in some of ours BPMs, because the same thing, when done in other BPMs, works fine.
    I know i can change the BPM to turn around this problem, but i would very much like to know the solution to this.
    Please, help us with this posting.
    thanks in advance
    Filipe Barreira

    Hi again,
    We are in SP19, witch invalidates the note 921757 listed.
    Also, i made an abap mapping witch only raises the exception. So i think it is not an ABAP error.
    Also the XML seems to be correct, because this is a duplicates check routine. A message (with the same data) already entered previously (we trying to avoid another entry).
    In the trace analysis for the message, it is stated that the exception has occurred:
      <?xml version="1.0" encoding="utf-8" ?>
    - <MappingTrace>
      <Trace level="1" type="T">Mapping-Namespace:http://xi.es/suministros</Trace>
      <Trace level="1" type="T">Mapping-Name:IM_SALIDAS_TESTE1</Trace>
      <Trace level="1" type="T">Mapping-SWCV:7CE651C00ABC11DBCBF0C8E8C0A901F6</Trace>
      <Trace level="1" type="T">Mapping-Step:1</Trace>
      <Trace level="1" type="T">Mapping-Type:R3_ABAP</Trace>
      <Trace level="1" type="T">Mapping-Program:ZCLTD_MM_SALIDAS_CARGA_TESTE</Trace>
      <Trace level="1" type="T">Creating Abap mapping. Classname =ZCLTD_MM_SALIDAS_CARGA_TESTE</Trace>
      <Trace level="1" type="T">CALL APPLICATION MAPPING.</Trace>
      <Trace level="1" type="T">Application error in mapping program ZCLTD_MM_SALIDAS_CARGA_TESTE, error code: , error text:</Trace>
      </MappingTrace>
    the problem is that the process keeps running.
    regards Filipe Barreira

  • PAPI WS and Process Webservice in the same BPM process

    Hello All -
    Can we use PAPI-WS and Process Webservice in the same BPM process?
    Here is my plan for usage.
    i. Use PAPI-WS for instance creation, workflow details and getting process instances.
    ii. Use Process Webservice to execute particular task.
    Did any one tried this and / or any idea on this?
    BR,
    Justin.

    Hi,
    You can use both interfaces but keep in mind that when exposing a process as a webservice the two activities that you can invoke are the Begin and the Notification Wait.
    Regards

  • Processing exception during a "GetData" operation when update XDP and PDF

    i came accross this error message when i want to update adobe interactive forms in SAPGui.
    Processing exception during a "GetData" operation.
    Request start time: Tue Jan 06 20:08:06 GMT 2008
    com.adobe.ads.exception.FailedCreationException:
    ADS restarted and tested fine but problem is not solved.
    could anyone experience this before? and how to you solved this?
    Thanks.

    There can be several reasons for getting this Error.
    1.ADS problem.
    2. Binding problem.
    3. Value node, Cardinality problem(1-n)
    4. Not mapping PDF Source problem
    5.PDFSource - type-Binary
    Please check it once. If you can post the total error it would be better.

  • BPM Developers and Process Modelers

    Hi, I am currently looking for Metastorm Developers and Process Modelers. The projects are located in NJ and NY. I am having a hard time finding people with this experience and I am hoping that someone can point me in the right direction. Any guidance is greatly appreciated!
    Thank You!
    Mai
    [email protected]

    Thanks for your feedback.
    We want to implement a SAP BPM scenario in a finance process for the VAT Tax reporting. So basically, our accountant needs to run some SAP transactions along with some manual outside steps. Then the supervisor will perform some checks and finally the tax manager needs to approve it.
    There is some interactions with SAP but only for a small part of the process. What we want to achieve is to be able to see the key performance indicator for our process. But at the moment this is not delivered with SAP BPM. I've heard that this may come in the next release end of 2009, but in the meanwhile I'm wondering if other people have been able to implement some customization in Net Weaver or have found other alternatives to be able to monitor their process adequately.
    Thanks
    Martin

  • Catch and cancel "Enter" processing in kIntComboBoxWidget

    Hello everyone!
    I've faced the following problem:
    My dialog contains kIntComboBoxWidget. I need to catch and cancel processing of Enter, Return keypress.
    I know (from documentation), that combobox consists of two controls: editbox and drop-downl list. So, I inherited kMyIntComboBoxWidgetBoss from kIntComboBoxWidgetBoss, signed it to IEventHandler through
    Class
    kPhfntFontSizeComboBoxWidgetBoss,
    kIntComboBoxWidgetBoss,
    IID_IEVENTHANDLER, kFontSizeComboBoxEventHandlerImpl,
    and also subsribed my my observer with WindetID to IID_IEVENTHANDLER protocol.
    But all I managed to catch - are messages from Dropdown-list. I could not catch any message from editbox.
    So, IID_IEVENTHANDLER for EditBox in ComboBox is not reachable for me.
    So why do a need to catch Enter-press? I just can't have any default OK button on my dialog, because it's presence on dialog leads to undefined behavoir to other controls on my dialog - I need to click twice on every control on order to LButtonUp invoked, though LButtonDown is invoked from the fist time.
    How can I do that?

    You know, I've just made some debug and there are some actions, which I've done:
    I've opened my dialog and:
    1st - clicked on some button(nothing happened),
    2nd - clicked on the same button (dialog closed-as my button closes it)
    Then, I've debugged it and discovered, that during first click, in EventHandler for my button only LButtonDn is invoked, LbuttonUp is NOT invoked during first click.
    But during the second click on the same button either LbuttonDn and LButtonUp are invoked.
    There is debug log:
    There are some strange differences, which I've selected in bold:
    SetLastEventCausedAlert false because msg:(0x201)
    PMSuperProcEnabler dispatching event kLButtonDn (0x12f010)
    DispatchToEventHandlers passed event to EH impl kTipsEHImpl (Class kTipsPanelBoss).
    DispatchToEventHandlers - EH Returned 0
    DispatchToEventHandlers passed event to EH impl kDialogEventFilterEHImpl (Class kDialogEventFilterBoss).
    DispatchToEventHandlers - EH Returned 0
    DispatchToEventHandlers passed event to EH impl kToolEventHandlerImpl (Class Unknown3rdPartyPrefix + 168 (0xe94a8)).
    DispatchToEventHandlers - EH Returned 0
    DispatchToEventHandlers passed event to DefaultEH
    CDefaultEH :: LButtonDn passing event(with sys window 0x1310ea) to eh impl Unknown3rdPartyPrefix + 162 (0xe94a2) of boss Unknown3rdPartyPrefix + 161 (0xe94a1) with WidgetID Unknown3rdPartyPrefix + 161 (0xe94a1)
    DispatchToEventHandlers - EH Returned 0
    PMSuperProcEnabler dispatching event unknown type (0x12f010)
    DispatchToEventHandlers passed event to EH impl kTipsEHImpl (Class kTipsPanelBoss).
    DispatchToEventHandlers - EH Returned 0
    b DispatchToEventHandlers passed event to EH impl kDialogEventFilterEHImpl (Class kDialogEventFilterBoss).
    b DispatchToEventHandlers - EH Returned 0
    b DispatchToEventHandlers passed event to EH impl kToolEventHandlerImpl (Class Unknown3rdPartyPrefix + 168 (0xe94a8)).
    b DispatchToEventHandlers - EH Returned 1
    SetLastEventCausedAlert false because msg:(0x201)
    PMSuperProcEnabler dispatching event kLButtonDn (0x12f010)
    DispatchToEventHandlers passed event to EH impl kTipsEHImpl (Class kTipsPanelBoss).
    DispatchToEventHandlers - EH Returned 0
    DispatchToEventHandlers passed event to EH impl kDialogEventFilterEHImpl (Class kDialogEventFilterBoss).
    DispatchToEventHandlers - EH Returned 0
    DispatchToEventHandlers passed event to DefaultEH
    CDefaultEH :: LButtonDn passing event(with sys window 0x1310ea) to eh impl Unknown3rdPartyPrefix + 162 (0xe94a2) of boss Unknown3rdPartyPrefix + 161 (0xe94a1) with WidgetID Unknown3rdPartyPrefix + 161 (0xe94a1)
    DispatchToEventHandlers - EH Returned 0
    PMSuperProcEnabler dispatching event unknown type (0x12f010)
    DispatchToEventHandlers passed event to EH impl kTipsEHImpl (Class kTipsPanelBoss).
    DispatchToEventHandlers - EH Returned 0
    b DispatchToEventHandlers passed event to EH impl kDialogEventFilterEHImpl (Class kDialogEventFilterBoss).
    b DispatchToEventHandlers - EH Returned 0
    DispatchToEventHandlers passed event to DefaultEH
    CDefaultEH :: LButtonUp passing event(with sys window 0x1310ea) to eh impl Unknown3rdPartyPrefix + 162 (0xe94a2) of boss Unknown3rdPartyPrefix + 161 (0xe94a1) with WidgetID Unknown3rdPartyPrefix + 161 (0xe94a1)
    It seems, like messages are posted there, where they should not be posted.
    It's there any ideas what's happening there?
    And one more detail: Buttons need two click on both platforms( Mac & Win), though, ComboBoxes need two click only on Windows - on Mac it works fine (Thanks for help in related thread!)
    Thanks!

  • Integration Process - Exception Handling

    Hi,
    I have developed an integration process, which call web-service, and catch it's exception. The problem is that the WS returns generic exception (SYSTEM) for all exceptions, but with different text for each one.
    Is there any way to get the exception text (the text itself and not the type), analyze it and handle the process correspondingly?

    Hi Shai,
    When you are calling the web-service method in BPM, put it in a block.....in the exception branch of the block, the control will go when the web-service will give exception.........so then put a switch in the exception branch - put the exception message as a condition for switching - do switching on basis of message text - and in the switch branches, do what you want to do for those exceptions.
    Hope it solves your query.
    Thanks,
    Rajeev Gupta

  • Application hangs when using ProcessStartInfo and Process.WaitForExit.

    I've looked on different threads about this, but all of them uses the Process.RedirectStandardOutput = True, which I don't.
    I'm trying to open a process (console application, not made by me) to make it compile a special .acs file to a .o file. The structure is simple, the only argument is the file you want to compile.
    But on certain files my application hangs when trying to open the process. Here's my code:
    Dim p As New Process
    Dim ps As New ProcessStartInfo
    ps.Arguments = SavePath 'Path example: "C:\Program Files (x86)\Zandronum\File.acs"
    ps.FileName = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory(), "Script Compilers\Zandronum\acc.exe")
    ps.CreateNoWindow = False
    ps.ErrorDialog = False
    ps.UseShellExecute = True
    ps.WindowStyle = ProcessWindowStyle.Hidden
    ps.WorkingDirectory = Path.GetDirectoryName(SavePath)
    Dim ErrorCaptured As Boolean = False
    Try
    p = Process.Start(ps)
    Catch ex As Exception
    ErrorCaptured = True
    End Try
    If ErrorCaptured = False Then
    p.WaitForExit()
    End If
    If ErrorCaptured = True Then
    Exit Sub
    End If
    Thanks!
    //Visual Vincent
    EDIT:
    For starting the process I use pretty much the same code that another guy made in C#. And his code is working perfectly...
    // Setup process info
    processinfo = new ProcessStartInfo();
    processinfo.Arguments = args;
    processinfo.FileName = Path.Combine(this.tempdir.FullName, info.ProgramFile);
    processinfo.CreateNoWindow = false;
    processinfo.ErrorDialog = false;
    processinfo.UseShellExecute = true;
    processinfo.WindowStyle = ProcessWindowStyle.Hidden;
    processinfo.WorkingDirectory = this.workingdir;
    try
    process = Process.Start(processinfo);
    catch(Exception e)
    // Unable to start the compiler
    General.ShowErrorMessage("Unable to start the compiler (" + info.Name + "). " + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK);
    return false;
    // Wait for compiler to complete
    process.WaitForExit();
    I hope your day has been better than yesterday, but that it's worse than tomorrow...
    Please mark as answer if I solved your problem. :)

    Hi,
     Have you compared the FileNames and Arguments of ones that work and ones that don`t? Is there any difference in them such as the ones that work do not contain blank spaces in the FileName or arguments and the ones that do work don`t contain blank spaces
    in them? If you find that to be the problem then you need to add Quotes to the beginning and end of the FileName or Arguments.
     My first guess is the Arguments needs the Quotes like this because, i see blank spaces in your example of the Arguments.
    ps.Arguments = Chr(34) & SavePath & Chr(34)
    If you say it can`t be done then i`ll try it
    This actually made it. I had forgotten that blank spaces makes it a new argument, silly me. I don't use process arguments that often. ;)
    Thanks alot!
    I hope your day has been better than yesterday, but that it's worse than tomorrow...
    Please mark as answer if I solved your problem. :)

  • Exception Handling in BPM

    Hello,
    1. I have created a block step B
    2. I have created a ReceiverDetermination and send step(S) inside Block B  .
    3. I have created ExceptionHandler EH.
    4. I have assigned this ExceptionHandler EH  in the send Block Exceptions-SystemError.
    5. In ExceptionHandler EH ,i have created a controlstep for throwing Alert .
    Problem i am facing now is when an error occurs in send step it is not throwing Exception.
    Did i missed something.
    Thanks in Advance for responses
    Rajesh

    Hello All,
                    Thanks for your replies,but in my case i have defined the ExceptionHandler and assigned the ExceptionName (EH) to the send step Exceptions-SystemError property ,and when i run the BPM scenario at the send error occured and it has to go to ExceptionHandler block which is not happening and i am seeing error at block as NoAgent error and i searched the forum for this error category and
    deleted all the BPM Instances and activated the Integration process but in vain ,
    I tried to throw exception intentionally and which worked well'
    Overall when an error occured at send it is not going to ExceptionHandling branch,What might be wrong
    I think send asynchronous step is capable of raising systemErrors right???
    Million dollars for the replies
    Waiting for responses
    -Rajesh

  • Catch the process id number in unix

    With my java program I run command in Unix. This application I start in background (nohup start.sh &). How can I catch the process ID number of my application? I use next string for code:
    String command[] = {"/bin/sh", "-c", "/bin/" + command, "/bin/searcId"};
    In run this line whit Runtime.exec()
    command is "nohup start.sh &" and the searchId is a Unix script for catching process ID number (this script works fine, when I run it in Unix).
    What can be wrong???
    MArko

    I arrived at this thread doing a Google search on how to obtain the process id of an executable launched from Java. The following code is not recommeded for released code, but it was helpful for my debugging purposes.
    try
        Process proc = Runtime.getRuntime().exec("executable");
        Field pidField = proc.getClass().getDeclaredField("pid");
        //pid field in UNIXProcess class is private - make it accessible
        pidField.setAccessible(true);
        System.out.println("Exec'ed process ID is: " + pidField.get(proc));
    catch (Exception e)
        e.printStackTrace();
    }The process id field for the UNIXProcess is "pid." On Windows, I believe it is "handle."

  • Process.getInputStream() and process.waitfor() block in web application

    Hi folks,
    i am really stuck with a problem which drives me mad.....
    What i want:
    I want to call the microsoft tool "handle" (see http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Handle.mspx) from within my web-application.
    Handle is used to assure that no other process accesses a file i want to read in.
    A simple test-main does the job perfectly:
    public class TestIt {
       public static void main(String[] args){
          String pathToFileHandleTool = "C:\\tmp\\Handle\\handle.exe";
          String pathToFile = "C:\\tmp\\foo.txt";
          String expectedFileHandleSuccessOutput = "(.*)No matching handles found(.*)";
          System.out.println("pathToFileHandleTool:" + pathToFileHandleTool);
          System.out.println("pathToFile: " + pathToFile);
          System.out.println("expectedFileHandleSuccessOutput: " + expectedFileHandleSuccessOutput);
          ProcessBuilder builder = null;
          // check for os
          if(System.getProperty("os.name").matches("(.*)Windows(.*)")) {
             System.out.println("we are on windows..");
          } else {
             System.out.println("we are on linux..");
          builder = new ProcessBuilder( pathToFileHandleTool, pathToFile);
          Process process = null;
          String commandOutput = "";
          String line = null;
          BufferedReader bufferedReader = null;
          try {
             process = builder.start();
             // read command output
             bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
              while((line = bufferedReader.readLine()) != null) {
                 commandOutput += line;
              System.out.println("commandoutput: " + commandOutput);
             // wait till process has finished
             process.waitFor();
          } catch (IOException e) {
             System.out.println(e.getMessage());
             e.printStackTrace();
          }  catch (InterruptedException e) {
             System.out.println(e.getMessage());
             e.printStackTrace();      }
          // check output to assure that no process uses file
          if(commandOutput.matches(expectedFileHandleSuccessOutput))
             System.out.println("no other processes accesses file!");
          else
             System.out.println("one or more other processes access file!");
    } So, as you see, a simple handle call looks like
    handle foo.txtand the output - if no other process accesses the file - is:
    Handle v3.2Copyright (C) 1997-2006 Mark RussinovichSysinternals - www.sysinternals.com
    No matching handles found.
    no other processes accesses file!(Wether the file exists or not doesnt matter to the program)
    If some processes access the file the output looks like this:
    commandoutput: Handle v3.2Copyright (C) 1997-2006 Mark RussinovichSysinternals - www.sysinternals.com
    WinSCP3.exe        pid: 1108    1AC: C:\tmp\openSUSE-10.2-GM-i386-CD3.iso.filepart
    one or more other processes access file!So far, so good.........but now ->
    The problem:
    If i know use the __exact__ same code (even the paths etc. hardcoded for debugging purposes) within my Servlet-Webapplication, it hangs here:
    while((line = bufferedReader.readLine()) != null) {if i comment that part out the application hangs at:
    process.waitFor();I am absolutely clueless what to do about this....
    Has anybody an idea what causes this behaviour and how i can circumvent it?
    Is this a windows problem?
    Any help will be greatly appreciated.....
    System information:
    - OS: Windows 2000 Server
    - Java 1.5
    - Tomcat 5.5
    More information / What i tried:
    - No exception / error is thrown, the application simply hangs. Adding
    builder.redirectErrorStream(true);had no effect on my logs.
    - Tried other readers as well, no effect.
    - replaced
    while((line = bufferedReader.readLine()) != null)with
    int iChar = 0;
                  while((iChar = bufferedReader.read()) != -1) {No difference, now the application hangs at read() instead of readline()
    - tried to call handle via
    runtime = Runtime.getRuntime();               
    Process p = runtime.exec("C:\\tmp\\Handle\\handle C:\\tmp\\foo.txt");and
    Process process = runtime.exec( "cmd", "/c","C:\\tmp\\Handle\\handle.exe C:\\tmp\\foo.txt");No difference.
    - i thought that maybe for security reasons tomcat wont execute external programs, but a "nslookup www.google.de" within the application is executed
    - The file permissions on handle.exe seem to be correct. The user under which tomcat runs is NT-AUTORIT-T/SYSTEM. If i take a look at handle.exe permission i notice that user "SYSTEM" has full access to the file
    - I dont start tomcat with the "-security" option
    - Confusingly enough, the same code works under linux with "lsof", so this does not seem to be a tomcat problem at all
    Thx for any help!

    Hi,
    thx for the links, unfortanutely nothing worked........
    What i tried:
    1. Reading input and errorstream separately via a thread class called streamgobbler(from the link):
              String pathToFileHandleTool = "C:\\tmp\\Handle\\handle.exe";
              String pathToFile = "C:\\tmp\\foo.txt";
              String expectedFileHandleSuccessOutput = "(.*)No matching handles found(.*)";
              logger.debug("pathToFileHandleTool: " + pathToFileHandleTool);
              logger.debug("pathToFile: " + pathToFile);
              logger.debug("expectedFileHandleSuccessOutput: " + expectedFileHandleSuccessOutput);
              ProcessBuilder builder = new ProcessBuilder( pathToFileHandleTool, pathToFile);
              String commandOutput = "";
              try {
                   logger.debug("trying to start builder....");
                   Process process = builder.start();
                   logger.debug("builder started!");
                   logger.debug("trying to initialize error stream gobbler....");
                   StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
                   logger.debug("error stream gobbler initialized!");
                   logger.debug("trying to initialize output stream gobbler....");
                   StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(), "OUTPUT");
                   logger.debug("output stream gobbler initialized!");
                   logger.debug("trying to start error stream gobbler....");
                   errorGobbler.start();
                   logger.debug("error stream gobbler started!");
                   logger.debug("trying to start output stream gobbler....");
                   outputGobbler.start();
                   logger.debug("output stream gobbler started!");
                   // wait till process has finished
                   logger.debug("waiting for process to exit....");
                   int exitVal = process.waitFor();
                   logger.debug("process terminated!");
                   logger.debug("exit value: " + exitVal);
              } catch (IOException e) {
                   logger.debug(e.getMessage());
                   logger.debug(e);
              }  catch (InterruptedException e) {
                   logger.debug(e.getMessage());
                   logger.debug(e);
         class StreamGobbler extends Thread {
              InputStream is;
             String type;
             StreamGobbler(InputStream is, String type) {
                 this.is = is;
                 this.type = type;
             public void run() {
                  try {
                     InputStreamReader isr = new InputStreamReader(is);
                     BufferedReader br = new BufferedReader(isr);
                     String line=null;
                     logger.debug("trying to call readline() .....");
                     while ( (line = br.readline()) != null)
                         logger.debug(type + ">" + line);   
                 } catch (IOException ioe) {
                         ioe.printStackTrace(); 
         }Again, the application hangs at the "readline()":
    pathToFileHandleTool: C:\tmp\Handle\handle.exe
    pathToFile: C:\tmp\openSUSE-10.2-GM-i386-CD3.iso
    expectedFileHandleSuccessOutput: (.*)No matching handles found(.*)
    trying to start builder....
    builder started!
    trying to initialize error stream gobbler....
    error stream gobbler initialized!
    trying to initialize output stream gobbler....
    output stream gobbler initialized!
    trying to start error stream gobbler....
    error stream gobbler started!
    trying to start output stream gobbler....
    output stream gobbler started!
    waiting for process to exit....
    trying to call readline().....
    trying to call readline().....Then i tried read(), i.e.:
         class StreamGobbler extends Thread {
              InputStream is;
             String type;
             StreamGobbler(InputStream is, String type) {
                 this.is = is;
                 this.type = type;
             public void run() {
                  try {
                     InputStreamReader isr = new InputStreamReader(is);
                     BufferedReader br = new BufferedReader(isr);
                     logger.debug("trying to read in single chars.....");
                     int iChar = 0;
                     while ( (iChar = br.read()) != -1)
                         logger.debug(type + ">" + iChar);   
                 } catch (IOException ioe) {
                         ioe.printStackTrace(); 
         }Same result, application hangs at read()......
    Then i tried a dirty workaround, but even that didnt suceed:
    I wrote a simple batch-file:
    C:\tmp\Handle\handle.exe C:\tmp\foo.txt > C:\tmp\handle_output.txtand tried to start it within my application with a simple:
    Runtime.getRuntime().exec("C:\\tmp\\call_handle.bat");No process, no reading any streams, no whatever.....
    Result:
    A file C:\tmp\handle_output.txt exists but it is empty..........
    Any more ideas?

Maybe you are looking for

  • Sharepoint 2013 - How to add "download link" to a column

    Hi there. We have download library with video files. We would like to add a column with a hyperlink of files in other words: DOWNLOAD LINKS. What would be the easiest way to achieve that? with best regards, bostjanc

  • Xls and csv file format

    I have a xls file that I can read and modify using POI. Users are providing another file in csv format that the program should read and make adjustments to the xls already read in the memory. Can anyone suggest the most efficient way to implement thi

  • Flash in PDF is disabling acrobat shortcuts!? Anyway to stop this happening?

    I've included some simple shockwave animations in a pdf to be viewed onscreen. The flash content seems to be disabling the arrow key (or any keyboard shortcuts for that matter) page advance in acrobat. Is there a way to stop this happening!? Someone

  • Account assignment is mandartory

    hi gurus, when i am trying to create PR for raw material and save it is displaying error mesage as " account assignment is mandatory for material". it is just a standard PR and everything is standard.  can anyone resolve this issue.

  • Need to provide receipt?

    On the Up-To-Date page, it says "To receive your OS X Mountain Lion upgrade, you must complete the order form and provide an electronic copy of a dated, itemized sales receipt indicating the marketing part number(s) of the qualifying product(s) purch