Activity - Publish Data
Overview
- Pushes data from a work item or asset to another work item or asset
- Which work items or assets the data is pushed to is dependant on a set of filters
- One example is that if both work items have the same value in a text component then the data will be pushed
Steps to set up this activity
- Create or have an existing workflow (I’ll call this Workflow A in this example and we will be publishing data FROM this workflow)
- You need Ecosystem Orchestrator permission to create a new workflow or Workflow Owner permission to edit an existing workflow
- Create or have another existing workflow (I’ll call this Workflow B in this example and we will be publishing data TO this workflow)
- Set up a publish data activity on the task that you want to publish data on Workflow A and set up these properties
- “relatedWork”: {
- “flowName”: the flow name of Workflow B
- Can be found under the “name” property in the “Properties” page on Workflow B
- “stepName”: is the name of the step that the component that you will use
- e.g. if the step’s “name” property is
- "name": "ecosystem/workflow/entity/generated-1af2a966-8383-467c-abe7-3be40544217b/untitledstep__generated-27fb4531-de5f-4bdf-8d1d-921f5f3c418b"
- Then the value to use in “stepName” would be
- /untitledstep__generated-27fb4531-de5f-4bdf-8d1d-921f5f3c418b
- “targetName”: “any string” (just used for labelling purposes)
- “sourceName”: “any string” (just used for labelling purposes)
- “workFilters”: [
- {
- “targetPath”: the data path from the component in Workflow B to match with the valuePath
- “valuePath”: the data path from the component in Workflow A to match with the targetPath
- When the task is submitted it will find the value in the valuePath property from Workflow A and check all the open work items in Workflow B and see if the value in targetPath matches, if they do match then the data from the dataMapping property will publish to these Workflow B work items
- }
- ],
- “createWorkIfNotFound”: false (set to false if you want to update existing work items, set to true if you want to create a new work item)
- },
- “publishDataDirection”: “ToRelatedEntity”,
- “operations”: [
- {
- “sectionName”: is the name of the task that the component that you will use in “workFilters” in Workflow B
- Like stepName but for the task not the step
- “dataMapping”: [
- {
- “fromPath”: the dataPath of the component in Workflow A that you want to take a value from
- “toProperty”: the dataPath of the component in Workflow B that you want to send a value to
- }
- ],
- “updateType”: “Set”,
- “targetPath”: “$”,
- “dataType”: “String”
- }
- ],
- “attachmentOperations”: [
- {
- “sourceFolder”: the dataPath of the attachments folder in Workflow A that you want to take attachments from
- “destinationFolder”: the dataPath of the attachments folder in Workflow B that you want to send attachments to
- }
- ]
- Create two work items in Workflow B, one with a particular value in a component (the one used in workFilters) and another with a different value in the same component
- Create a work item in Workflow A and add the same particular value to the component that is that is used in workFilters
- Also add a value in the component used in the dataMapping property
- Publish this work item
- Done!
- You will see that on Workflow B work item, that had a value in the workFilters component that matches the value form the Workflow A work item, now has the value in the component used in the dataMapping property from the Workflow A work item
Advanced Editor properties and what they do
Properties shared between activities
Property | What does the property do (in plain english) | Possible values | How to find these values (in plain english) |
displayName | label of the activity | any string | |
comments | additional comments on what the activity do | any string | |
executeWhen | decides on when to execute the activity
| BeforeExecute
AfterExecute
OnExecute
Manual | |
runOnSystemEvents | specify an action event (that starts with $) that this activity will be executed | [”$actionEvent1”, “$actionEvent1”] | |
expression | data path expression if it satisfies then it will execute this activity | e.g. "'{$.asset.id}' = “123" |
Properties unique to this activity
- All of these unique properties sit within a “properties” object e.g.
{
"property one shared between components": "",
"properties": {
"entityType": "",
"etc": "",
}
}
Property | What does the property do (in plain english) | Possible values | How to find these values (in plain english) |
saveEmptyValue | Flag if value should be saved despite it’s empty | ||
publishDataDirection | The direction of publish data | "FromRelatedEntity”
"ToRelatedEntity”
"ToSelf” | |
operations | List of operations for publishing data | See Operations table below | |
attachmentPaths | List of attachment folders to publish. Used in the replacement of attachmentOperations in the niche case where you give both the source and target folders the same name (through advanced editor) | [”folder1”, “folder2”] | In this case it would copy folder 1 in work item to folder 1 in asset type and folder 2 in work item to folder 2 in asset type |
attachmentOperations | List of operations for publishing attachment | See Attachment operations table below | |
relatedWork | Related Item which the data will be published from or to. | See Related Work table below |
Operation
Property | What does the property do (in plain english) | Possible values | How to find these values (in plain english) |
sectionName | Name of task to publish data | Called the section name in the database but it is actually the task name and you can find this as the value after the last “/” on the “name” property of the task in advanced editor | |
dataMapping | List of how data is mapped | [
{
fromPath: “$.vessel”,
toProperty: “componentName”
}
] | For the toProperty take the right most element from your dataPath for the component that you want to publish to (e.g. $.task.task.componentName you would just put in “componentName”) |
updateType | Type of update to perform | "Push"
"Set"
"Rename"
"Pull"
"Unset"
"AddToSet"
"Publish"
"Merge"
"Replace"
"Increment"
"Decrement" | |
targetPath | The first part of the dataPath for the target component | “$.task.task” | if the dataPath is $.task.task.componentName |
dataType | The type of data being updated | "None"
"Object"
"Array"
"Constructor"
"Property"
"Comment"
"Integer"
"Float"
"String"
"Boolean"
"Null"
"Undefined"
"Date"
"Raw"
"Bytes"
"Guid"
"Uri"
"TimeSpan” | |
excludeProperties | List of properties to exclude in publishing. Usually used with private data so that it is not accidentally published | [”$.privateData"] | Just the datapath of the component for the flow that you are in |
Attachment Operation
Property | What does the property do (in plain english) | Possible values | How to find these values (in plain english) |
sourceFolder | Name of folder from source work | “{stepName}-{attachmentComponentName}” | |
destinationFolder | Name of folder to destination work |
Related Work
Property | What does the property do (in plain english) | Possible values | How to find these values (in plain english) |
flowName | Name of the related flow that the related work is in | “walking-duck/workflow/entity/generated…” | from object flow: name
Find flow name in the properties. Copy the whole value from the “name” component under flow properties
|
stepName | Name of task which data will be published | “untitlestask_generated-f13123…” | from task object in flow object: name |
targetName | Name for target in relationship | Just a superficial name that you can create in this activity | |
sourceName | Name for source in relationship | Just a superficial name that you can create in this activity | |
createWorkIfNotFound | Flag if work should be created if there’s no related work | true or false | |
addRelationship | Flag to automatically add relationship to work | ||
isOneWayRelationship | If both flows have a relationship to each other then you can set this to true. | true or false | |
workFilters |
Advanced Editor example of this activity fully set up
{
"continueOnError": false,
"executeWhen": "AfterExecute",
"runOnSystemEvents": [],
"properties": {
"saveEmptyValue": true,
"publishDataDirection": "ToRelatedEntity",
"attachmentPaths": [],
"operations": [
{
"sectionName": "untitledtask__generated-f11b49f2-b2b6-453a-a28e-ffa361db8a11",
"dataMapping": [
{
"fromPath": "$.myText1",
"toProperty": "targetText"
}
],
"updateType": "Set",
"targetPath": "$",
"dataType": "String",
"excludeProperties": []
}
],
"attachmentOperations": [
{
"sourceFolder": "firstStep-attachment",
"destinationFolder": "targetFirstStep-anotherAttachment"
}
],
"relatedWork": {
"flowName": "walking-duck-four/workflow/entity/generated-842df0c3-f6ec-4056-82af-42db5c289115",
"stepName": "untitledtask__generated-f11b49f2-b2b6-453a-a28e-ffa361db8a11",
"targetName": "Delivery",
"sourceName": "Order",
"workFilters": [],
"createWorkIfNotFound": true,
"removeExisting": false,
"addRelationship": true,
"isOneWayRelationship": false
}
}
}
Video explanation
- Coming soon…