Friday, June 23, 2017

Workflow Catalog through Examples

Introduction with an example : the workflow lifecycle management

Today let’s discover the new workflow catalog from ProActive. In a few words, the Workflow Catalog is a ProActive component that provides storage and versioning of Workflows through a REST API.

For a simplified explanation, we have here an example of ProActive utilization with three buckets. Each buckets represents a different stage of the workflow lifecycle. For instance, the workflow1, in the development bucket, was edited 3 times at the moment. Each edition corresponds to a revision. All the people who have access to the same bucket can read and write on all the workflows and their revisions.

A few use cases :

How would you handle sharing workflows ? Since buckets can be accessed by several users, transferring workflows between buckets simplifies the sharing process.

What about when you need a specific workflow within hundreds ? Don’t worry, use the search tool to narrow the list returned. Parameters such as owner can be used, other custom fields are also available thanks to generic information (e.g. infrastructure, language, etc.).

You found new bugs in the latest workflow revision ? The delete function can remove a selected revision to come back to another version.

Now let’s try some of these functions :



CREATE a bucket

REST API

curl --request POST \
--url 'https://try.activeeon.com/workflow-catalog/buckets?name=my_first_bucket&owner=admin' \
--header 'accept: */*'

RESULT

The id of my_first_bucket is 4. We are going to import a workflow in.

IMPORT a workflow in a bucket

REST API

curl --request POST \
--url https://try.activeeon.com/workflow-catalog/buckets/4/workflows \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form “file=@/home/damn/Downloads/my_first_workflow.xml

(the red text has to be edited according to your case)

RESULT

The bucket contains now our workflow.
We will see the command to see his revision.

SEARCH a version of a workflow

REST API

curl --request GET \
--url https://try.activeeon.com/workflow-catalog/buckets/4/workflows/37/revisions \
--header 'accept: */*'


(the red text has to be edited according to your case)

RESULT

You can see that the revision always starts by one.

ADD revision

Now we are going to add a revision at this new workflow :

REST API

curl --request POST \
--url 'https://try.activeeon.com/workflow-catalog/buckets/4/workflows/37/revisions?=' \
--header 'accept: */*' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form “file=@/home/damn/Downloads/My_first_workflow_and_revisions/my_first_workflow_revision_2.xml


(the red text has to be edited according to your case)

RESULT

The name of the workflow changed since I changed my workflow’s name at each revision. Success !

DELETE a revision

Now, we are going to delete a revision, but before that, with the same command, we will add two others revisions named : my_first_workflow_revision3 and my_first_workflow_revision4.
Thus, we have :

We are going to delete the revision 2.

REST API

curl --request DELETE \
--url https://try.activeeon.com/workflow-catalog/buckets/4/workflows/37/revisions/2 \
--header 'accept: */*'


(the red text has to be edited according to your case)

RESULT

On the workflow catalog nothing changed but if you display the revisions with the REST API, the revision 2 does not appear.
Now, let’s try to delete the revision4.

The workflow passed to the previous revision : the third.

Now, if you delete this revision you will come back to the first version because we already deleted the version two.

No comments:

Post a Comment