One condition execute one or more policies.

My use case is i have condition to be executed in target preflow,where is the condition is true i would like to execute two policies in a row.Is it possible?

0 4 1,664
4 REPLIES 4

@archana ,

Solution #1 :

There are multiple ways to achieve same, Create a conditional flow & add your policies there. Find more about conditional flows in above link.

Solution #2 :

Add conditions to step functions (policies) in XML,

Find more about conditional policies here.

For Example,

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
    <Description/>
    <FaultRules/>
    <PreFlow name="PreFlow">
        <Request>
            <Step>
                <Condition>request.verb = "GET"</Condition>
                <Name>Quota-1</Name>
            </Step>
            <Step>
                <Condition>request.verb = "GET"</Condition>
                <Name>JSON-to-XML-1</Name>
            </Step>
        </Request>
        <Response/>
    </PreFlow>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <Flows/>
    <HTTPTargetConnection>
        <Properties/>
        <URL>https://www.googleapis.com/books/v1/volumes</URL>
    </HTTPTargetConnection>
</TargetEndpoint>

So if all conditions that are true then Does all policies are executed in the order specified ?What if one the condition in between fail ,will it check the other conditions?

@archana

If conditions are true then associated policy will be executed, if any condition turned out to be false then associated policy will be skipped. Let me know if it helps.

Yes it does thanks .I have added the parameters in assign message ,how to send them to the target url in JS which i rewrote accordingly.