I want to activate a flow that will return a message if the status code isn’t 200.
I use Apigee’s mocktarget statuscode to mimic status code 400.
However, when I use trace I see two conditions, with the following expressions:
(((error.state equals TARGET_REQ_FLOW) or (error.state equals TARGET_RESP_FLOW)) or ((error.state equals REQ_SENT) or (error.state equals RESP_START)))
and
("default" equals target.name)
I have the following flow:
<PreFlow name="PreFlow">
<Request/>
<Response>
<Step>
<Name>slack-alert-flow</Name>
<Condition>response.status.code != 200</Condition>
</Step>
</Response>
</PreFlow>
If the condition is true it should go to a shared flow with the following assign message policy:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="return-failure">
<DisplayName>return failure</DisplayName>
<Properties/>
<Set>
<Payload contentType="text/plain">Your call failed</Payload>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>
How can I return the payload created in the assign message policy to the end user?