Conditional Flow name to use in sharedflow

may
Bronze 5
Bronze 5

What I need: Conditional Flow's name.

Basically, I need to know which Conditional Flow (Condition matched) was "chosen" when we get to Target Request Flow Started.

conditional flow 2024-01-15 12 56 58.png

target request flow started 2024-01-15 10 26 52.png

What I'm trying to do: I have a sharedflow that gets an Spike Arrest value in a KVM based on the flow's name.

For instance, in the KVM I would have the value in a .json:

"Feriados":
{
   "value":"100pm"
},

And I have the following Conditional flow:

 

<Flow name="Feriados">
            <Description></Description>
            <Request/>
            <Condition>(proxy.pathsuffix MatchesPath "/feriados/*/*") and (request.verb = "GET")</Condition>
</Flow>

 

What I've tried:

I tried to use the pathsuffix (instead of the Target Request Flow) but when it comes to wildcards I'm not sure how to make them match.

So if the request's pathsuffix is "/feriados/21/23" and in the KVM is "/feriados/*/*" then it doesn't get matched. Therefore, I'm trying to use the flow's name (in this example, it would be "Feriados"), but I don't know how to get this flow's name and send it to the sharedflow because when I use current.flow.name variable it get's the flow the sharedflow is set ("postflow").

Any ideias on how to do this, please?

Thanks in advance.

2 1 141
1 REPLY 1

Hi. The flow variable current.flow.name gives the name of the flow which is being executed when the variable is being read. This flow variable keeps updating as the request is moves from different proxy flows. 
One approach would be to create a flow variable referencing this variable when the request enters the conditional flow. You can use assign message policy for this in the conditional flows.

<AssignVariable>
<Name>cf_name</Name>
<Ref>current.flow.name</Ref>
</AssignVariable>