Update Asset Value
The update asset value activity creates a link between work items and assets in your ecosystem. It allows you to select components in the task and components within an asset type, and links them. Once a task with this activity is submitted/ended, the value in the component of the work item becomes the new value of the component in the asset selected.
Setting up the activity using No Code
To set up an update asset value activity, select it in the +Add activity dropdown. This opens up the Update asset value modal:
Under Asset to update is a select component from which you must select the asset search component from the task. Assets selected in this component within work items have their data updated through this activity.
Under Take value from is a select component from which you must select a component within the task. The data in this component is the new data that the selected asset will undertake.
Under Update value at is a select component from which you must select a component within the asset type. This is the component in which data will be updated.
Clicking the +Value button allows you to select another component to update another value in the asset, allowing multiple asset values to be changed simultaneously.
Use Case Example
Student John wants to transfer from Harvard to MIT, changing his student number too:
In this workflow, there’s a text input called New university name and a number input called Student number, and an asset search component. In the Update asset value modal, clicking under Asset to update shows you the asset type you have selected in the asset search component, so in this workflow we want to update students:
Under Take value from you select the New university name component:
And link it under Update value at to the University asset property:
Clicking on the +Value button and selecting the options that link the student number component in the workflow to the student number property in the asset type allows for simultaneous updates:
From here, any time a work item submits this task, whatever name is put into the New university name component will now replace the University component in the selected student’s asset, the same going for the student number.
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) |
entityType | target asset type to update | <ecosystem-name>-<asset-type> | see screenshot below |
entityIdDataPath | target asset item to update | $.t1.t1.assetSearch.id
just add “.id” at the very end | see screenshot below |
entityTypeComponentId | asset search layout component id | any id | see screenshot below |
enable | decides whether to update the entity or not. useful for tesing out the action | true or false | |
publishOperation | fromPath = dataPath of the data you want to extract
fromPathComponentId = component id of the fromPath sits in
toProperty = dataPath of where you want to set the data
sectionName = target the section name of the asset item (the property “name” of the section in the asset type that holds the target component) | sample json below | |
fromDatePath | n/a | empty string or “” | |
dataPath | n/a | “$” |
entityType
{ecosystem name}-{asset type name}
entityIdDataPath
{data path of asset search component}.id
entityTypeComponentId
{id of the asset search component}
Either the dataPath with .id at the end or find the id in the inspect tab
publishOperation
{
"publishOperation": {
"dataMapping": [
{
"fromPath": "$.t1.t1.text",
"toProperty": "$.details.details.assetProperty1"
}
],
"sectionName": "bethuel-eight/entity/entity/generated-7d8f796b-e960-4148-a578-a4f57bcb670a/untitledstep__generated-c27f6b67-bc50-4492-b942-106122b57c52/untitledtask__generated-960b7263-2f9d-41fb-a5a0-b8d6960519c1"
}
}
sectionName
fromPath
fromPathComponentId
Although this is not required this is used as a indicator in this UI (”TAKE VALUE FROM:”). Not setting this property will render this UI as blank.
toProperty
toPropertyComponentId
Although this is not required this is used as a indicator in this UI (”UPDATE VALUE AT:”). Not setting this property will render this UI as blank.
Advanced Editor example of this activity fully set up
{
"continueOnError": false,
"executeWhen": "AfterExecute",
"runOnSystemEvents": [],
"properties": {
"fromDatePath": "",
"dataPath": "$",
"entityType": "ecosystem-assetType",
"entityIdDataPath": "$.taskOne.taskOne.assetSearchComponentInWorkflow.id",
"entityTypeComponentId": "00000000-0000-0000-0000-000000000000",
"enable": false,
"publishOperation": {
"dataMapping": [
{
"fromPath": "$.taskOne.taskOne.textComponentInWorkflow",
"toProperty": "$.asset.asset.textComponentInAssetType"
}
],
"sectionName": "namePropertyOfSectionOfAssetTypeOfToProperty"
}
}
}