Does anybody know if this is a bug with Apigee or a mistake in the documentation?
The docs say:
"Enclose variable names in curly braces { }. If the variable does not exist, an empty string is returned in the output"
However, the following throws an error (FCVariableResolutionFailed)
<FlowCallout name="FlowCallout-MySharedFlow">
<Parameters>
<Parameter name="into.my-shared-flow.param1">{a.variable-that-does-not-exist}</Parameter>
</Parameters>
<SharedFlowBundle>my-shared-flow-v0</SharedFlowBundle>
</FlowCallout>
Solved! Go to Solution.
Same issue, it seems <IgnoreUnresolvedVariables> has no effect with FlowCallout.
It seems the best solution is to use the firstnonnull message template function:
<FlowCallout name="FlowCallout-MySharedFlow">
<Parameters>
<Parameter name="into.my-shared-flow.param1">{firstnonnull(a.variable-that-does-not-exist,)}</Parameter>
</Parameters>
<SharedFlowBundle>my-shared-flow-v0</SharedFlowBundle>
</FlowCallout>
It seems like that IS a documentation bug.
Try including IgnoreUnresolvedVariables in the policy.
<FlowCallout name="FlowCallout-MySharedFlow">
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<Parameters>
<Parameter name="into.my-shared-flow.param1">{a.variable-that-does-not-exist}</Parameter>
</Parameters>
<SharedFlowBundle>my-shared-flow-v0</SharedFlowBundle>
</FlowCallout>
Same issue, it seems <IgnoreUnresolvedVariables> has no effect with FlowCallout.
It seems the best solution is to use the firstnonnull message template function:
<FlowCallout name="FlowCallout-MySharedFlow">
<Parameters>
<Parameter name="into.my-shared-flow.param1">{firstnonnull(a.variable-that-does-not-exist,)}</Parameter>
</Parameters>
<SharedFlowBundle>my-shared-flow-v0</SharedFlowBundle>
</FlowCallout>
Thanks for contributing that suggestion!