How to access the properties defined in Flow Call Out policy in shared flow

Hi,

We are trying to use Shared Flow for combining common functionalities and we would like to provide few parameters as input to shared Flow by passing properties in the flow call out policy. But we are not get these properties values in the java script with in shared flow and also they don't show up in tracing.

Could you please suggest on how to send parameters or properties to Shared Flow without using AssignMessage policy in the proxy?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FlowCallout async="false" continueOnError="false" enabled="true" name="SF_SharedRules">
    <DisplayName>SF_SharedRules</DisplayName>
    <FaultRules/>
    <Properties>
        <Property name="name1">value1</Property>
        <Property name="name2">value2</Property>
    </Properties>
    <SharedFlowBundle>SharedFlow_SharedRules</SharedFlowBundle>
</FlowCallout>
2 4 1,221
4 REPLIES 4

I agree that it would be nice to be able to parameterize the call to a shared flow with the properties. Today, I don't think these properties are available for access within the shared flow as it executes.

Let me double-check that, and get back to you.

Reference: b/74750586

Was this ever resolved? I would like to be able to pass values from a flow callout via properties.

Mmmmmmm, good news and bad news.

The Good news

Yes, it was resolved. Here's how you can parameterize FlowCallouts:

<FlowCallout name="Flow-Callout-1">
    <Parameters>
      <Parameter name="input">{system.timestamp}</Parameter>
      <Parameter name="outputVarName">message.header.bar</Parameter>
    </Parameters>
    <SharedFlowBundle>Shared-Flow-1</SharedFlowBundle>
</FlowCallout>

The way it works:

Each Parameter element under the Parameters parent ... causes a variable to be set at the inception of the FlowCallout. These variables then are available to all policies in the sharedflow. If any policy in the sharedflow sequence changes any of those variables, then, the changed value is available to subsequent policies in the sharedflow.

Each Parameter element has these settings:

  • name attribute, specifying the name of the parameter, in other words the name of the context variable to set for the inception of the sharedflow.
  • value attribute, specifying a text value to insert into the named context variable
  • ref attribute, specifying the name of a variable to resolve. The resolved value is then inserted into the named context variable
  • the text value, treated as a message template. So you can use curly braces and so on.

I'm not sure of the precedence of value, ref and text value.

At the termination of the sharedflow, the original values of all of those Parameter variables, if any, are restored.

The Bad News

This implementation was not shipped to production! Gah!

The release of this enhancement is still pending. It works in pre-production, I promise! Sorry, I don't have a schedule for when this will go live. I'll check again.

Thanks @Dino-at-Google for the reply. For now we can just implement it with a var in an assign message policy and then revisit the change when this enhancemnet goes live. Appreciate your response.