Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

What is a Converge Action?

The

Insert excerpt
_action_converge
_action_converge
nopaneltrue
 action is used to combine two or more paths together within an Actionflow, passing through attributes that are common to all incoming paths. It does not merge any records.  

Insert excerpt
_action_converge
_action_converge
nopaneltrue
 actions are useful where data has been split to be processed separately but then needs to be brought back together for an action that only accepts one input, e.g. a 
Insert excerpt
_action_save
_action_save
nopaneltrue
 action.

Creating Converge Actions

  1. Click and drag the 
    Insert excerpt
    _action_converge
    _action_converge
    nopaneltrue
     icon from the toolbar onto the canvas
  2. Enter a name for the Converge action, then select Create Action
    1. In the Converge Action 
      Insert excerpt
      _property_settings
      _property_settings
      nopaneltrue
       on the right, click the 
      Insert excerpt
      _add_icon
      _add_icon
      nopaneltrue
       icon in the Output Attributes section to add new attributes, if required
  3. Connect to the Converge action by hovering over each input action node and selecting out, then create a new input connection point on the Converge action

Output Attributes

The Converge Node will only pass through attributes that are common to all paths, therefore, use Output Attributes to converge attributes to a common name. Once created, map to the Output Attributes using the attributes from incoming paths.

To check if a record in an Actionflow has a value mapped to an Output Attribute in a Converge Node, use the ifUnavailable function in a 

Insert excerpt
_action_calculate
_action_calculate
nopaneltrue
 action. See 1.11 Calculate Action Configuration.

For example, if there are three paths being passed into a Converge Node, and one of the paths does not have an attribute mapped to an output attribute, trying to reference that output attribute later in the Actionflow will throw an error on a record where there was no attribute mapped. The ifUnavailable function can be used to capture and handle this scenario.

HTML Comment
hiddentrue

Insert excerpt
Converge Node
Converge Node
nopaneltrue

Worked Example

Here's a worked example using the Shop Data (available from the Learning Centre).

In this example, we are using:  

  • A Customer Form screen containing blank input fields, set up to create a new customer  - this screen was created using the Edit Form template
Tip

If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Intermediate Application. For this example, we'll be working on the Save button on the Customer Form screen.

If you have completed 2.07 Embedded Actionflows prior to starting this worked example, ensure the Actionflow on the Save button on the Customer Form screen is 

Insert excerpt
_remove
_remove
nopaneltrue
d. Then re-add a simple Save Action using the Form Actions wizard.

Expand
titleHow?

Right-click on the screen and choose 

Insert excerpt
_actionflow_icon
_actionflow_icon
nopaneltrue
 Add Form Actions.

Drag

Insert excerpt
_save_icon
_save_icon
nopaneltrue
 Save Record onto the Save button.


Process New Customers Differently Depending on Mailing List Subscription

For this example, we'll create an Actionflow that splits our data depending on if a new customer has joined a mailing list, allowing the customers who have joined to be processed separately. The new customer data for both the customer who have and haven't joined the mailing list is them converged back together so that the customer record can be updated with the current date and time (for the LastUpdated attribute), and the new customer record saved back to the table.

We recommend that you have prior knowledge of 

Insert excerpt
_action_gateway
_action_gateway
nopaneltrue
 actions and 
Insert excerpt
_action_email
_action_email
nopaneltrue
 actions or have completed 2.03 Gateway Action Configuration and 2.05 Email Action Configuration.

Initial Setup

  1. Open the Customer Form and
    Insert excerpt
    _unlock
    _unlock
    nopaneltrue
     the screen
  2. Open the Actionflow on the Save button
  3. Click on the input connection point (under Connections) and map in the following attributes into the Actionflow:
    1. email
    2. first_name
    3. LastUpdated
    4. mailingList
  4. Disconnect the 
    Insert excerpt
    _input
    _input
    nopaneltrue
    from the
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     action on the canvas

Gateway Setup

  1. Create a 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     action
    1. Name: Mailing List
  2. Drag the 
    Insert excerpt
    _input
    _input
    nopaneltrue
     node onto the Gateway action
  3. Map the mailingList attribute into the 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
    action on the in connector
  4. Click on the 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     node to open its Properties
    1. Toggle on, Exclusive
    2. Modify the existing Rule and
      Insert excerpt
      _add
      _add
      nameadd
      nopaneltrue
       another Rule, as detailed below:

      1. Code Block
        themeEmacs
        titleName: EmailMe
        in.mailingList == true



      2. Code Block
        themeEmacs
        titleName: DontEmailMe
        in.mailingList != true


  5. Insert excerpt
    _save
    _save
    nopaneltrue
     the gateway settings
  6. Hover over the Gateway action to show the 2 output connections

    1. Click on DontEmailMe, then click on any white space on the canvas and use the popup menu to create a new 
      Insert excerpt
      _action_converge
      _action_converge
      nopaneltrue
       action
      1. Name: CombineData
      2. Map across the customerID attribute
    2. Repeat with the EmailMe output connection and create a new 
      Insert excerpt
      _actionflow_icon
      _actionflow_icon
      nopaneltrue
       Embedded Actionflow
      1. Name: SendWelcomeEmail

        Expand
        titleCheckpoint


Embedded Actionflow Setup

  1. Click on the EmailMe connector and map in the attributes that will be needed to send a welcome email to the new customer:
    1. customerID
    2. email
    3. first_name
  2. Hover over the Embedded Actionflow node and choose out to connect the SendWelcomeEmail Embedded Actionflow node to the CombineData
    Insert excerpt
    _action_converge
    _action_converge
    nopaneltrue
     action
    1. After clicking on the Converge node, choose Add Input and name the connection 
    2. Map across the customerID attribute
  3. Right-click on the SendWelcomeEmail Embedded Actionflow and choose 
    Insert excerpt
    _actionflow_display
    _actionflow_display
    namedisplay
    nopaneltrue
  4. On the SendWelcomeEmail Actionflow, create a new 
    Insert excerpt
    _action_email
    _action_email
    nopaneltrue
     action
    1. Name: WelcomeEmail
  5. Connect the
    Insert excerpt
    _input
    _input
    nopaneltrue
     node to the
    Insert excerpt
    _action_email
    _action_email
    nopaneltrue
     action
  6. Map the same attributes as above into the Email action
  7. Click on the Email Action to open its
    Insert excerpt
    _property_settings
    _property_settings
    nopaneltrue
     and
    Insert excerpt
    _pin
    _pin
    nopaneltrue
     the tab
  8. For the From field, we need to use the email address specified as the login email in your Outbound Emailer; to find this, in the 
    Insert excerpt
    _repository
    _repository
    namefull
    nopaneltrue
    , expand 
    Insert excerpt
    _emailConfiguration
    _emailConfiguration
    nameaccounts
    nopaneltrue
    1. Double-click on 
      Insert excerpt
      _emailConfiguration
      _emailConfiguration
      nameicon
      nopaneltrue
       Outbound emailer and copy the login email 
  9. Paste this into the From field on your pinned 
    Insert excerpt
    _action_email
    _action_email
    nopaneltrue
     properties, and enter the following:
    1. To:

      Code Block
      languagejs
      themeEmacs
      ${in.email}


    2. Subject:

      Code Block
      languagejs
      themeEmacs
      Welcome ${in.first_name}!


    3. is HTML: Toggle on off 
      Insert excerpt
      _toggle_off
      _toggle_off
      nopaneltrue
       
    4. Message:

      Code Block
      languagejs
      themeEmacs
      Hello ${in.first_name} and welcome to the PhixFlow Shop Newsletter. Thank you for joining our mailing list. We'll send you news and offers every week!


      1. Leave all other fields blank
    5. Insert excerpt
      _finish
      _finish
      nopaneltrue
  10. Hover over the Email action and select out
  11. Click on the

    Insert excerpt
    _output
    _output
    nopaneltrue
     node under Connections to map the data back to the Save Actionflow 

    Expand
    titleCheckpoint


Converge & Calculate Setup

  1. Click back into the Actionflow for the Save button
  2. From the CombineData 
    Insert excerpt
    _action_converge
    _action_converge
    nopaneltrue
     action, click out and create a 
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     action
    1. Name: SetLastUpdated
    2. Map the attribute, LastUpdated, into the 
      Insert excerpt
      _action_calculate
      _action_calculate
      nopaneltrue
       action
  3. On the Calculate action, add an Output Attribute:
    1. Name: SetLastUpdated
    2. Type: Datetime
    3. Expression: now()

      Expand
      titleCheckpoint


Save Setup

  1. Connect the Calculate action to the Save action
    1. Map across the customerID attribute from the Converge action to the Save
    2. Map across the SetLastUpdated attribute from the Calculate action to the LastUpdated attribute on the Save

      Expand
      titleCheckpoint


Testing

To test the Actionflow we need to add two new customers. 

  1. Close and reopen the Customer Form
  2. Insert excerpt
    _lock
    _lock
    nopaneltrue
     the screen and enter the details for a new customer, ensuring:
    1. for the Email Address field, you enter your own email address
    2. for the "Would the customer like to join the mailing list?" field, you toggle the switch on 
  3. After pressing Save, you should see the customer is saved on the Customer screen and you should receive an email 
  4. Repeat these steps to create another customer, using your email address but this time, toggle off "Would the customer like to join the mailing list?"
  5. Check that the customer is still created and saved on the Customer screen but that no email is received


2.11 Custom Validation