Hi,
I want to create the below flow. I know how to use each individual policy but the flow definition language seems lacking the ability of splitting the flow into 2. Please, what are my options to define this branch mechanism which might become more complex in the future?
Regards,
Solved! Go to Solution.
I understand what you're saying.
In the Apigee Domain-specific language for flows, Condition elements apply to Step elements.
Aside from the "Shared flow" concept, There is no way to define a Sequence of Steps, and wrap them all with a Condition. There is no way to define a callable "local sequence".
I like the idea of doing something like this:
<Flow name="myflow">
<Request>
<Step>
<Name>Cache-Lookup-1</Name>
</Step>
<If>
<Condition>cached_variable != null</Condition>
<Then>
<Step>
<Name>AM-AssignB</Name>
</Step>
</Then>
<Else>
<Step>
<Name>JavaCallout-1</Name>
</Step>
<Step>
<Name>Cache-Populate-1</Name>
</Step>
<Step>
<Name>AM-AssignB</Name>
</Step>
</Else>
</If>
</Request>
<Response>
<Step>
<Name>AM-Response</Name>
</Step>
</Response>
<Condition>(proxy.pathsuffix MatchesPath "/t1") and (request.verb = "GET")</Condition>
</Flow>
...but there is nothing in the Apigee flow language to support this kind of control. Currently you need to copy/paste the Condition statement in each step that should be in the THEN clause, and apply the opposite of the Condition statement for each step in the Else clause.
Hi @optimism
Yes, it seems more suitable for flows that will be shared amon multiple proxies however, I think it is an overkill to create a share flow each time I want to reuse a flow in the same proxy.
Regards'
Hany
Just use simple conditional flow to achieve it.
https://docs.apigee.com/api-platform/reference/conditions-reference
https://docs.apigee.com/api-platform/reference/flow-configuration-reference
use below reference for flow variables(it helps a lot).
https://docs.apigee.com/api-platform/reference/variables-reference
I understand what you're saying.
In the Apigee Domain-specific language for flows, Condition elements apply to Step elements.
Aside from the "Shared flow" concept, There is no way to define a Sequence of Steps, and wrap them all with a Condition. There is no way to define a callable "local sequence".
I like the idea of doing something like this:
<Flow name="myflow">
<Request>
<Step>
<Name>Cache-Lookup-1</Name>
</Step>
<If>
<Condition>cached_variable != null</Condition>
<Then>
<Step>
<Name>AM-AssignB</Name>
</Step>
</Then>
<Else>
<Step>
<Name>JavaCallout-1</Name>
</Step>
<Step>
<Name>Cache-Populate-1</Name>
</Step>
<Step>
<Name>AM-AssignB</Name>
</Step>
</Else>
</If>
</Request>
<Response>
<Step>
<Name>AM-Response</Name>
</Step>
</Response>
<Condition>(proxy.pathsuffix MatchesPath "/t1") and (request.verb = "GET")</Condition>
</Flow>
...but there is nothing in the Apigee flow language to support this kind of control. Currently you need to copy/paste the Condition statement in each step that should be in the THEN clause, and apply the opposite of the Condition statement for each step in the Else clause.