Run a Workflow from App Config
In this article, we can configure a workflow to run when the map is initialized.
important
Configuring a workflow to run when the map is initialized can be done through Geocortex Mobile Designer and this is the preferred method of configurable if Designer can be used. The goal of this article is to demonstrate the pattern of overriding behaviors with workflows.
Prerequisites
Follow along by setting up the Geocortex Mobile SDK and editing the minimal layout and app config provided.
tip
If you just need to make a small change to the layout and app config of an existing application, you can download the config and layout files for the application, tweak them, and then re-upload them.
First, let's create a basic map using the layout and app config.
- Layout
- App Config
Next, add a app item to the configuration for the map component, and configure the map to run ui.display-notification
on initialization as a test.
- App Config
- Layout
The next step is going to be replacing the ui.display-notification
command with a workflow.run-*
command. First, we need to create a workflow to use for the command.
- Open up Geocortex Workflow Designer and create and save a new workflow.
tip
Optionally, you can download this example workflow that displays an alert and then import it into the Geocortex Workflow Designer.
- Add an "Alert" activity as a test.
- Copy the ID of the the workflow from the URL
- Add the workflow as an app item to your app config.
tip
The target
property of the workflow app item determines the container in which the workflow UI, such as a form, will be displayed.
Finally, you can configure the map to run this workflow on initialization.
- App Config
- Layout
- UI
Relevant SDK Samples
The Geocortex Mobile SDK Samples project has a variety of workflow samples:
Next Steps
Geocortex Workflow
Learn more about Geocortex Workflow
Change the Default Map Click Behavior with a Workflow
Learn more about overriding default behaviors