Exercise 6.3 | Authoring Workspace Chains in Automations |
Data | Voting Divisions (GML (Geography Markup Language)) Addresses (Esri Geodatabase (File Geodb API)) |
Overall Goal | Create an Automation to chain the previous two translations together |
Demonstrates | Authoring workspace chains using Automations |
Start Workspace | None |
End Workspace | None |
You have just finished creating a workspace that uses the FMEServerJobSubmitter transformer to chain two workspaces together so that they run consecutively. Now the team has requested you to update this workflow so that they can easily re-run it automatically whenever they update the Election Voting GML file.
You know you can set up an automation to automatically run the parent workspace you created before, but then you'd have both the automation and that parent workspace to update if anything in this workflow changes. You realize that you can handle the job chaining within an Automation as well.
1) Create Automation
In the FME Server interface, navigate to the Automations > Build page to start building a new Automation.
Save the Automation first and give it a name such as JobChaining.
2) Add Trigger
You want these jobs to start running whenever new data is added, so set up a Trigger to handle that.
Click on the Trigger that is already placed in your Automation to configure it. Set the Trigger as follows:
Parameter | Value |
---|---|
Trigger | Directory Modified |
Directory to Watch | Data > Election > Input |
Events to Watch for | MODIFY |
Directory to Watch | Poll Interval |
Events to Watch for | 30 Seconds |
WARNING |
We're setting the Poll Interval here to 30 seconds just to make testing faster for the purposes of training. For regular use, we'd recommend using minutes as the minimum interval.
If you end up with many Automations all set to poll every few seconds, it could take a toll on system performance. |
3) Add Workspace Action
Now we want to add an Action to run the first of the two workspaces we want to run in our job chain.
Click on the + button and drag an Action onto the canvas. Connect it to the Directory Watch Trigger and configure it as follows:
Action | Run Workspace |
Repository | Training |
Workspace | AdvancedWorkflows-Ex2-CompleteA.fmw |
4) Add Second Workspace Action
Notice that unlike the FMEServerJobSubmitter, the Workspace Action does not have an option for wait for job to complete. This is because a Workspace Action will always wait until the job has completed before moving onto the next Action within the Automation.
To set up the second workspace to run, simply add a second Action and connect it to the checkmark (or Action Succeeded) port on the Workspace Action we just added. Configure this one to run the AdvancedWorkflows-Ex2-CompleteB.fmw from inside the Training repository.
Your final Automation should look like this:
5) Save and Start Automation
Save your Automation. Then click the Start Automation button to start the Automation.
6) Test the Automation
Now you can the Automation by uploading a modified version of the ElectionVoting.gml file to Resources.
Open the Resources page and navigate to Data > Election > Input. Click on Upload > Files and select the following two files to upload:
- C:\FMEData2019\Resources\ServerAuthoring\JobChaining\ElectionVoting.gml
- C:\FMEData2019\Resources\ServerAuthoring\JobChaining\ElectionVoting.xsd
Wait a minute or so and then View Triggered Jobs for your Automation, you should see that both chained workspaces successfully ran in order.
CONGRATULATIONS |
By completing this exercise you have learned how to:
|