-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Parent Task #50
To support the Workflow manager's ability to have conditional workflows we need the tasks to be able pass meta data about themselfs back the workflow manger after been completed.
The Task update status event to the workflow manager will contain a metadata attribute containing all the metadata dictionary for that task if said task generats metadata.
Part 1
This task meta data will be required to be stored in a JSON block in such a way as to allow simple access of the data for use in further workflow conditonal statments, new tasks, and stored in MongoDb.
Structure of the JSON object for the storage of the task metadata:-
{
"workflowexcutionid":"{workflowexcutionid}"
"tasks":[
{
"taskname": "{taskname}",
"taskexcutionid": "{taskexcutionid}",
"datadictionary":{
"key":"value",
"key": "value",
...
}
},
{
"taskname": "{taskname}",
"taskexcutionid": "{taskexcutionid}",
"datadictionary":{
"key":"value",
"key": "value",
...
}
},
...
]
}
Part 2
The tasks metadata needs to be accessible for the Conditional system. This will tie in to the Conditial system's string replacement ability when parsing the user conditional Clause(S).
- When then Contional Parser encounters a string in this format {{context.executions.task['TaskID'].'Key'}}
- This will trigger a search of task metadata for the current workflow execution. Looking for a match for the 'TaskID'
- If no match can be found then a null is returned.
- if a match if found for the 'TaskID' then it will search the Tasks Meta data dictionary for the requested 'Key'
- If no Key match is found then return a null.
- If a key match if found then return the value from the Selected Tasks Meta data dictionary.
Part 3
When you lanuch a new task the task can have named paramaters ( Input paramaters ) which are extracted for the current meta data store.
Acceptance Criteria
- GIVEN a valid task update status event WHEN the metadata is availibe Then the workflow manager will update Stored metadata JSON object with the new metadata.
- GIVEN a conditional statement WHEN the statement is Parsed and the tasks metadata key is requested Then the metadata value for the key is resolved.
- GIVEN a conditional statement when the statement is Parsed and the tasks metadata key is requested but doesn't exeist Then the returned Value is Null.
Tests
- Publish Task Update Event with status Success adds metadata to the Workflow Instance
- Publish Task Update Event with status Accept adds metadata to the Workflow Instance
- Publish Task Update Event with status Failed does not add metadata to the Workflow Instance
- Publish Task Update Event with status Success with metadata key which is used in conditional statement. Task dispatch message is published
- Publish Task Update Event with status Success with metadata key missing which is used in conditional statement. Task dispatch message is not published
Metadata
Metadata
Assignees
Labels
Type
Projects
Status