SSHOC / sshoc-marketplace-backend

Code for the backend
Apache License 2.0
2 stars 0 forks source link

How to correctly update a workflow and its associated steps? #156

Closed dpancic closed 1 year ago

dpancic commented 2 years ago

In GitLab by @stefanprobst on Feb 4, 2022, 11:54

it is currently not clear to me what the frontend needs to do in order to correctly update a workflow and its associated steps. it would be very helpful to have some documentation on this.

to be more concrete, this is one of the issues i am currently running into:

what am i doing wrong here?

here's what the draft workflow looks like after the first "Save as draft" ```json { "id": 52, "category": "workflow", "label": "workflow", "persistentId": "la4jjM", "lastInfoUpdate": "2022-02-04T10:48:07+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "workflow", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [ { "id": 53, "category": "step", "label": "first step", "persistentId": "GjkpzS", "lastInfoUpdate": "2022-02-04T10:48:08+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "first step", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [] }, { "id": 54, "category": "step", "label": "second step", "persistentId": "FueAzf", "lastInfoUpdate": "2022-02-04T10:48:08+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "second step", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [] } ] } ```
here's what the draft workflow looks like after the second "Save as draft" (nothing was edited since) ```json { "id": 52, "category": "workflow", "label": "workflow", "persistentId": "la4jjM", "lastInfoUpdate": "2022-02-04T10:49:03+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "workflow", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [ { "id": 53, "category": "step", "label": "first step", "persistentId": "GjkpzS", "lastInfoUpdate": "2022-02-04T10:49:03+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "first step", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [] }, { "id": 54, "category": "step", "label": "second step", "persistentId": "FueAzf", "lastInfoUpdate": "2022-02-04T10:49:03+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "second step", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [] }, { "id": 53, "category": "step", "label": "first step", "persistentId": "GjkpzS", "lastInfoUpdate": "2022-02-04T10:49:03+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "first step", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [] }, { "id": 54, "category": "step", "label": "second step", "persistentId": "FueAzf", "lastInfoUpdate": "2022-02-04T10:49:03+0000", "status": "draft", "informationContributor": { "id": 1, "username": "Administrator", "displayName": "Administrator", "status": "enabled", "registrationDate": "2020-08-04T12:29:00+0000", "role": "administrator", "email": "administrator@example.com", "config": true }, "description": "second step", "contributors": [], "properties": [], "externalIds": [], "accessibleAt": [], "relatedItems": [], "media": [], "composedOf": [] } ] } ```
dpancic commented 2 years ago

In GitLab by @tparkola on Feb 10, 2022, 08:47

I found why the draft step was duplicated. It was due to adding again draft step after update to step_tree. Issue was fixed, and merged to dev.