You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Quick-Start Tutorial 2

Now lets expand a bit on the previous Tutorial and introduce some more advanced ACP concepts.

Step 1: Navigate to your ACP instance and open the Actions Menu by clicking on the icon in the upper-left.  Find the ‘My Workflows’ area and click the ‘more…’ link.

Step 2:  Find the “Tutorial Workflow” you created following the Quick-Start Tutorial 1.  Click on the blue ‘Clone’ button and enter “Tutorial Workflow 2” as the new name.  Click ‘clone.’

Step 3: Click “Tutorial Workflow 2” to open your new workflow.  This workflow is an exact copy of the previous tutorial, complete with all steps, settings, and connectors.

Step 4: Click the ‘Get Resources’ step we created previously and scroll down to the ‘name’ field we assigned to ‘Default Value: TLR’.  Change this field to ‘user given.’

The form changes to allow you to name this user-given variable we just declared.  Name it ‘resource-name.’

Step 5: Save the workflow and execute it.  A form pops up listing off all the user-given variables required to run the workflow.  In this case there is only one, but there can be as many as are needed. Enter ‘TLR’ as the resource-name and click ‘execute.’

The resultant id is the same.

Step 6:  Execute the workflow again, but this time enter in the name ‘does not exist.’  

This resource obviously does not exist, and so the id returned is ‘null.’  Lets instead alter the routing of the Get Resources create the resource if it is not found.

Step 7:  Add a new step to the workflow by selecting the ‘sixconnect’ connector, then the ‘resources’ family, and finally the ‘Create Resource’ action.

Step 8:  Add a third step to the workflow by selecting the ‘sixconnect’ connector, then the ‘resources’ family, and finally the ‘Resource Query’ action.  Note this is different from the ‘Get Resource’ action we use as Workflow Step #1.

You should have a 3-step workflow, like so:

Step 9:  Open up the first step, in blue, of the workflow.  Scroll down to the ‘Conditions and Routes’ area at the bottom.  This is the area where the decision logic is stored. Currently it is configured to proceed directly to the Output whenever the step successfully returns data.  We are going to add a second condition to handle the case where a resource is not found.

Step 10:  Click the ‘+’ icon in the upper left of the Conditions area to add a new Condition.  It is added at the bottom of the list.  

Change the name of the first condition to read ‘Resource Not Found’ and the name of the second condition to read ‘Resource Found.’

Step 11:  Edit the ‘Resource Not Found’ condition so that the left value is set to ‘body’ and its ‘id’ property.

Set the operator for the ‘Resource Not Found’ condition to ‘NULL.’

Set the ‘Route’ to ‘Create Resource’.

Step 12:  Change the route for the ‘Resource Found’ step to ‘Resource Query.’  

Step 13:  Close the ‘Get Resource’ step by clicking on the blue header, then expand the ‘Create Resource’ step by clicking on its green header.  Scroll down to the two required parameters, ‘name’ and ‘type’.  

Change ‘name’ to be ‘user given’, and as its value put ‘resource-name’, which is the same variable we defined in the previous step.  The same value will be used for both parameters.

Change the ‘type’ input to ‘default value,’ and give it a default value of ‘resource’

Scroll down to the Conditions area and change the Route for the only condition to be the final step, ‘Resource Query.’

Close the ‘Create Resource’ step.

Step 14:  Expand the ‘Resource Query’ step.  We have two previous steps which can route into this step under different conditions.  This is a unification step, to standardize the data coming back. Scroll down to the optional parameters and find ‘name.’  As in the previous step, make this parameter ‘user given’ with a variable name of ‘resource-name’.  

This will use the same variable we’ve used in previous steps.

Close the ‘Resource Query’ step.

Step 15:  Lastly, open the ‘Output’ step and change it so we are taking the ‘id’ parameter from the ‘Resource Query’ step, and not the ‘Resource Get’ step.

Step 16:  Save and execute the workflow with the resource name ‘TLR’.  As before, the returned id will be 1.

Step 17:  Execute the workflow again with a resource name “nonexistant’.  As this resource is being created by the system, its id will be the next available.

Step 18:  Execute the workflow again, again with a resource name ‘nonexistant’.  This time the resource does exist, since we created it on the last execution.  Its id is unchanged.

For additional insight into how Workflow Routing functions, turn on Debug Mode by clicking on the ‘Preferences’ link at the top of the screen and enabling it.  Running the workflow with Debug Mode on will show all the steps of the workflow and what order they were run, as well as if they were skipped. This can be very helpful for debugging complex processes.



  • No labels