Wait On External System
  • Updated on 22 Jul 2016
  • 7 minutes to read
  • Print
  • Dark
    Light

Wait On External System

  • Print
  • Dark
    Light

This tutorial demonstrates how to use Wait On External System step in Decisions . This step is an Assigned Form for the External System (Service, External Database etc.) . This step monitors External System , and when the desired condition is met, continues Flow execution on the Defined Outcome Path .
Example:
In this example we are going to useWait On External System step to monitor External Database (Customers table in Northwind database) . If new Customer is added to the table, our Flow will stop monitoring External Table , send an Email to notify that new Customer was added to the table, and start monitoring Customers Table again.
This example assumes the Northwind database has been integrated with the Portal. For your own purposes, you can use your default Decisions database or you can integrate with another database. For more information on integrating a database, see Integrating an External Database with a Flow .

2018-03-08_095408.png

Next, we navigate to the Designer Folder and click Create Flow on the Folder Actions Panel.
2018-03-08_095919.png

In the resulting window we Name the Flow and click Create to proceed to the Flow Designer.
2018-03-08_100723.png

In the Flow Designer we add Get all from dbo.Customers step from Integrations > My Integrations > Database > Northwind (Database) > dbo.Customers (Table) category.
2018-03-08_101724.png

Then, we connect Failed outcome from Get all from dbo.Customers step to the End Step in our Flow . And, set Limit Count Inputs to Ignore .
2018-03-08_101937.png

On the Done outcome from the Get all from dbo.Customers step we add Wait On External System step from Integrations > All Integrations category.
2018-03-08_102142.png

2018-03-08_102209.png

Next, we are going to set up our Wait On External System step. First, we configure Service Definition Settings . We leave Generate Service check-box unchecked because we do not need to use this step via Service call in this example.
Then, we click Add New link to Expose Data On Service for our Wait On External Step to be able to operate with data from our Flow .
2018-03-08_102336.png

In the resulting window we Name our Data and pick Type . In this example we are going to expose Results from Get all from dbo.Customers step, therefore we pick Northwind_dboCustomers Type and checkIs List and Can Be Null check-boxes. Click Ok to save and continue.
2018-03-08_102535.png

2018-03-08_102952.png

Wait On External System step has similar behavior asExternal Form . If we click View Integration Details link we should be able to see how to integrate with this Service .
2018-03-08_103022.png

Then, we are going to set up Timer Settings . First, we Add New Scenarios [Additional Outcomes for AutoComplete] . Each of this Scenarios is going to be anEnd Step in the AutoComplete Flow for this step.
2018-03-08_103124.png

In the resulting window we Name our Scenario .
2018-03-08_103200.png

Next, we Add New Parameters . These Parameters are going to be AutoComplete Flow Outcome Data from this Scenario (Outcome Path) . We Name Parameter and define its Type (Northwind_dboCustomers) . This will be a single Customer that will be added to our Customers database. We will need to use it later in our main Flow . When finished click Ok to save and close this window.
2018-03-08_103532.png

2018-03-08_103608.png

Back to Wait On External System settings, we define Check Time Span . This Time Span will be used by the step to monitor the External System . In this example we set it to check every 15 seconds.
2018-03-08_103720.png

Next, in the Inputs Section for the Customers Input we Select Value of the Customers_Result from Get all from dbo.Customers step.
2018-03-08_103815.png

Finally, we click Edit icon for Is Complete Flow . This Flow will be monitoring our External System and evaluating which outcome path our Flow should take.
2018-03-08_104258.png

Is Complete Flow opens in the Flow Designer . We can see that our Flow has twoEnd Steps . Step Not Complete (Default) and CustomerAdded (defined by us as Outcome Scenario previously in this tutorial). We are going to build this Flow to check if a new record is added to the Database and if it is, we are going to proceed on CustomerAdded outcome, and if not we will proceed on Step Not Complete outcome.
2018-03-08_104404.png

After Start step in the Flow we add Get all from dbo.Customers step from Integrations > My Integrations > Database > Northwind (Database) > dbo.Customers (Table) category.
2018-03-08_104709.png

Then, we connect Failed outcome to the Step Not Complete End Step. On the Done outcome we add Greater Than Rule Step from All Steps [Catalog] > Data > Numbers category.
2018-03-08_104946.png

2018-03-08_105024.png

Then, we select Get all from dbo.Customers step on the work-space and set it up as following… We Ignore Limit Count input and change Output Variable Name and Custoners_Result output***Name*** .
2018-03-08_105321.png

2018-03-08_105455.png

Then, we select Greater Than step on the work-space and click Show Mapping Editor.

2018-03-08_105712.png

In the Mapping Editor we map Customer_Result New.Count (Get all from dbo.Customers in this Flow) to value1 and Customers_Result.Count (Flow input from the Main Flow) to value2 . When finished save and close Mapping Editor.
2018-03-08_110722.png

Next, we connect False outcome from Greater Than Rule to the Step Not Complete End Step . On the True outcome we add ForEach Step from Flow Management category.
2018-03-08_111131.png

In the resulting window select Pick the option Customers_Result_New as Select Value [From Flow] for ForEach Step and Data type.
2018-03-09_163417.png

Then, on the Next outcome from the ForEach Step we add String is Not in List Step from the All Steps [Catalog] >Data > Text category.
2018-03-08_115942.png

Next, we click Show Mapping Editor for String is Not in List step.
2018-03-08_120102-1.png

In the Mapping Editor we use CustomerID list from Customers_Result (Flow input) as a list value and Item.CustomerID as a value to check. When finished we can save and close Mapping Editor.
2018-03-08_121749.png

Then, on the True outcome from String is Not in List step we add Create Data Step from the Favorite Steps category.
2018-03-08_132308.png

For the Create Data Step we Add New Data Definition to be a Customer of Type Northwind_dboCustomers. Then, click Ok to save and continue.
2018-03-08_133248.png

2018-03-08_133355.png

Next, for the Customer Input to the Create Data Step we Select Value of the Item outcome from the ForEach Step.
2018-03-08_133502.png

We connect Done outcome from Create Data Step to CustomerAdded End Step in our Flow . Then, we Select Value of Customer output from Create Data Step to be an Output on the CustomerAdded End Step in our Workflow .
2018-03-08_134220.png

2018-03-08_134313.png

We connect the rest of the Outcome Paths from our steps as following:

  • False outcome from Greater Than step to Step Not Complete End Step
  • False outcome from String is Not in List step to ForEach Step
  • Done outcome from the ForEach Step to CustomerAdded End Step.

This completes our Is Complete Flow . We can save it and close Flow Designer.
2018-03-08_134845.png

Back to our Main Flow we add Send Email Step from Favorite Steps category on CustomerAdded outcome from Wait On External System Step .
2018-03-08_135420.png

Then, we click Show Mapping Editor option for Send Email step.
2018-03-08_141303.png

2018-03-08_141319.png

In the Mapping Editor we define Constant From Email Address , To Email Address , and Subject . For Email Body we use Text Merge.Plain Mapping type and click Show Editor.
2018-03-08_142628.png

In the Text Merge Editor we use Customer Properties to compose Email Body Notification . When finished we click Ok to save and continue. Then, we save and close Mapping Editor.
2018-03-08_143228.png

Back in the Flow Designer we connect sent outcome from Send Email step back to Get all from dbo. Customers step (to continue monitoring our External Database) . Failed outcome from Get all from dbo. Customers step goes to the End Step in our Flow . This completes our Flow ; we can click Test Flow on the top panel of the Flow Designer to test.
2018-03-08_145129-1.png

Flow starts in the Debugger and stops on Wait On External System step. At this point we start to monitor our External Database and wait until new Customer is Added .
2018-03-08_151603.png

We go to ourExternal Database and Add new record to our Customers Database.
2018-03-08_151926.png

Back in the Flow Debugger our Wait On External System step detects that new Customer was added to the Database and continues Flow Execution.
flowContinuesExec.png

And, we receive an Email notifying us that New Customer was Added .
Our Flow execution goes back to Get all from dbo.Customers step and Waits On External System again.
2018-03-08_152015.png

If we add another Customer to our Database
addMore.png

Flow continues execution and we receive another Notification Email from our Flow .
emailReceivedTwo.png

Was this article helpful?