Skip to Content

Endless loop in UDF

I have some questions concerning user defined functions (UDF) in mappings.

  • Is it possible to produce an endless mapping process, by writing an endless loop in the UDF or is there a timeout for mappings?
  • If there is no timeout and I produce an endless loop, how to stop it? Is it possible to stop the "process" which runs the endless udf instance? (If so, is there a way over NWA/Administration or only via terminal?)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 02, 2016 at 08:32 AM

    Hi,

    Just to add.

    In a sync scenario if you set a timeout at a channel/adapter level this parametrization can help to avoid endless mappings to crash the system:

    Channel Specific Timeout Configuration (Synchronous Interfaces)

    In asyn cases, at least in a dual system you can configure a timeout o maximum time of processing at IE level, and this would be helpful (check 2.1 and 2.2 points):

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c059d583-a551-2c10-e095-eb5d95e03747?QuickLink=index&…

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 01, 2016 at 08:17 AM

    Hi Raffael,

    Is it possible to produce an endless mapping process, by writing an endless loop in the UDF or is there a timeout for mappings?

    AFAIK there is not a timeout for mapping, but there are for example a maximum time of execution inside PI, timeout for adapter waiting, etc. Therefore, you can do and endless loop but a exception will be raised.

    If there is no timeout and I produce an endless loop, how to stop it? Is it possible to stop the "process" which runs the endless udf instance? (If so, is there a way over NWA/Administration or only via terminal?)

    As I've said there are several controls to avoid one communication have a workproccess eternally.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

    • In case there is the following call inside an UDF:

      Process p = Runtime.getRuntime().exec(command)


      If the command will never return a result, the adapter will raise an timeout exception. Did I understood you correct? If so, will the process started by the UDF also canceled because it's a child process of the UDF's process or do I have to cancel the process "p" manually?

  • Mar 01, 2016 at 08:19 AM

    Hello Raffael,

    Are you trying to hold the message processing from sometime in the mapping?The below link should help you

    HOW TO DELAY (USE WAIT STEP) MESSAGE IN SAP PI WITHOUT ccBPM

    And for cancelling the particular message which is delayed you can cancel that message in RWB.

    Add comment
    10|10000 characters needed characters exceeded