[workflowId]-page
Overview
The [workflowId]-page serves as a dedicated interface for editing and managing workflows within the Vantage analytics and data platform. The page utilizes a component called WorkflowWrapper which provides the necessary functionalities to interact with workflows identified by a unique workflowId parameter obtained from the URL. This page is pivotal in facilitating the creation, modification, and removal of workflows in a user-friendly manner.
Settings
The settings for the [workflowId]-page are primarily derived from its properties and functionality within the WorkflowWrapper component. Below is an exhaustive explanation of the settings utilized.
1. workflowId
- Input Type: String
- Description: This parameter captures the unique identifier of the workflow that is being edited. The
workflowIdis paramount because it connects the user interface to the specific instance of the workflow stored in the backend. - Impact of Changing: Modifying this parameter directly affects which workflow is loaded into the interface. If an invalid or non-existent
workflowIdis provided, the interface may display an error or an empty state, indicating that no workflow corresponds to the given ID. - Default Value: There is no default value for this setting, as it must always be provided through route parameters.
2. store
- Input Type: Object (specifically,
mainWorkflowStore) - Description: This property allows the
WorkflowWrapperto utilize the main workflow state store which contains the state and methods necessary for interacting with workflows, including retrieval and updates of workflows. - Impact of Changing: While the current implementation uses a hardcoded reference to
mainWorkflowStore, if another store were to be provided, it would change how data is fetched and modified in the interface. However, any store used must align with the expected structure of workflow data. - Default Value: This setting is typically instantiated within the code and does not have a configurable default since it is imported from the application's state management.
How It Works
The WorkflowEditorPage functions as follows:
-
URL Parameter Retrieval: It first retrieves the
workflowIdfrom the URL using theuseParamshook. This parameter is critical for fetching the specific workflow instance. -
Rendering Component: It returns a
divthat hosts theWorkflowWrappercomponent. This component receives themainWorkflowStoreand the retrievedworkflowIdas props. -
State Management: The
WorkflowWrapperthen manages the state of the workflow usingmainWorkflowStore, allowing users to view, edit, and save changes to their workflows.
Data Expectations
The [workflowId]-page expects data in the following forms:
-
Persistent Storage: The workflow data must be stored in a format compatible with
mainWorkflowStore. This typically includes the structure of workflows, which could comprise elements like name, description, tasks, statuses, and connections between tasks. -
User Input: As the user interacts with the
WorkflowWrapper, it anticipates input in the form of strings (for names or descriptions), and selections for dropdowns or checkboxes depending on the editable attributes of the workflow.
Use Cases & Examples
Use Case 1: Workflow Editing
A data analyst needs to update an existing data processing workflow to include additional data sources. They access the [workflowId]-page, input the ID of the workflow they need to modify, and use the interface to include the additional sources efficiently.
Use Case 2: Workflow Creation
An operations manager creates a new workflow for weekly reports. While the [workflowId]-page does not handle creation directly, they can modify an existing template workflow (by retrieving it via its workflowId) to create a new one that suits their needs.
Example Configuration
Use Case Example: A user wants to modify the workflow with ID 12345 to include a new data source and change the workflow name.
Expected Configuration Data:
{
"workflowId": "12345",
"store": "mainWorkflowStore",
"updates": {
"name": "Weekly Sales Reports",
"dataSources": [
"sourceA",
"sourceB",
"sourceC" // newly added source
],
"description": "This workflow processes the weekly sales data."
}
}This configuration indicates that the user wishes to access and modify the workflow identified by workflowId 12345 within the mainWorkflowStore, changing the name and updating the data sources accordingly.