cancel
Showing results for 
Search instead for 
Did you mean: 

use custom message in exception subprocess with error/escalation end

former_member537554
Participant

Hello,

Currently, I'm creating iFlows with custom interfaces. When one puts an exception subprocess in an iFlow with an error/escalation end the sender will receive a message like below:

An internal server error occured: Message ended with Escalation end event. The MPL ID for the failed message is : <MPL ID> For more details please check tail log.

What I would like to do is to return a custom message, while maintaining the escalated / error label in the message monitor.

My question is whether this is possible to do and how.

Thanks in advance!

Bram

balazsbence95
Active Participant
0 Kudos

Hi,

Please, remove tag SAP Cloud Integration for data services since this issue here has nothing to do with CPI-DS.
Queries regarding iFlows belong to the Process Integration team (LOD-HCI-PI-OPS). You may address this query to the PI Community.

Thank you,
Bence

View Entire Topic
Sriprasadsbhat
Active Contributor

Hello Bram,

I have tried this feature and its not working as expected. Below are the few pointers.

1) Custom Exception can be set but Message Processing Status in CPI would be COMPLETED ( Usage of Error End or Message End ).

----> Remove property "CamelExceptionCaught" using Content Modifier and use below script.

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
    //Body 
    def body = message.getBody();
    def map = message.getHeaders();
    map.put("Content-Type",   "application/json");
    map.put("CamelHttpResponseCode",   400);
  
    message.setBody("{\"status\": \"Hey Bond,please check CPI monitoring for error details\"}");
    
    return message;
}

2) You want to make Message Processing Status in CPI to be FAILED or ESCALATED with standard error response

---->Just add the Exception Subprocess and set the event as Error End or Escalation.

3) You want to throw Custom Exception back to Sender and set the Message Processing Status in CPI to be FAILED or ESCALATED.

---->This is not working in SAP CPI and following up with development team.You can raise Ticket to SAP team so that this can be prioritized.

Regards,

Sriprasad Shivaram Bhat

former_member537554
Participant
0 Kudos

Hi Sriprasad,

Thanks for helping out. We will raise a ticket to SAP.

Best,

Bram

maik_bosch
Contributor

bramkeijers and sriprasadshivaramabhat

do we have any update regarding Option 3

3) You want to throw Custom Exception back to Sender and set the Message Processing Status in CPI to be FAILED or ESCALATED.

---->This is not working in SAP CPI and following up with development team.You can raise Ticket to SAP team so that this can be prioritized.

Hemant_CG
Explorer
0 Kudos

Hi sriprasadshivaramabhat,

Is there an update on this feature?

Thanks,

Hemant

maik_bosch
Contributor