Run a Workflow from App Config
Many components have default behaviors which can be configured through the app config JSON. Any configurable property which takes a command or operation as its value can also be configured with a special command, workflow.run
. By using the workflow.run
command, you can even execute a workflow with completely configurable behavior.
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 Web 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 Web SDK and editing the minimal layout and app config provided.
- Check out the deployment instructions to learn about how to deploy layout and app config to an application.
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.
Finally, you can configure the map to run this workflow on initialization.
- App Config
- Layout
- UI
You've now successfully customized behavior through the app config with a workflow. From this point, you could develop the workflow further to solve your business case.
tip
For a more in depth example, check out the tutorial on overriding default map click behavior with a workflow.
Next Steps
Build a Custom Form
Learn how to build a custom form with Geocortex Workflow
Implement a Custom Activity
Learn how to implement a custom activity with the Geocortex Workflow SDK
Implement a Custom Form Element
Learn how to implement a custom form element with the Geocortex Workflow SDK
Change Geocortex Web's Default Map Click Behavior
Learn how to Geocortex Workflow to override Geocortex Web's default map click behavior