Create a process

Create a process to define a data model to hold the user details and define activities to manage the user.

  1. Navigate to Workflow > Business processes.
  2. Click New. The process opens in a new browser tab.
  3. Enter User Demo as the Name.

Add a data model

Add a data model to define the structure that will hold the user details.

  1. On the Data models tab, click New.
  2. Change the name of the model to User.
  3. First examine the service you will execute. In a new web browser tab, browse to https://reqres.in/
  4. Scroll down to the methods and click CREATE.
    Add data model

    The Request and Response share some common fields (name and job). So rather than creating two models, you can create a single model.

  5. Copy the following JSON:

    {
        "name": "morpheus",
        "job": "leader",
        "id": "16",
        "createdAt": "2021-05-05T11:08:27.903Z"
    }

  6. In the Add Data model dialog box, select Load from external source, paste the sample JSON into the File content box, and then click Add. The fields are automatically added to the data model structure.
    Add a Data Model structure
  7. In addition to the fields from the sample JSON, supplement your model with additional information.

    Name Type
    Team Text
    updatedAt Date

  8. Click Add to add the model to your process.

Create variables

  1. Select the Variables tab and click New.
  2. Enter MyUser as the Name.
  3. Select Data object as the Type.
  4. Select Local Data Model and then select User as the Value.
  5. Click Add.

Add an activity to enter user details

Add an ordinary activity to allow you to enter details of the user being created.

  1. Click the Design tab to return to process design.
  2. On the Start node, add an Ordinary activity.
  3. Type Enter User Details as the Name.
  4. Add the following output variables to the activity and click Done:

    • MyUser.name

    • MyUser.job

    • MyUser.Team

Add an activity to create user

On the Enter User Details activity, add an activity to create a user.

  1. Select Other > RESTful service as the Type.
  2. Enter Create User as the Name.
  3. Select REQ as the Web service.
  4. In the URL parameters, enter users.
  5. Select POST as the Verb.
  6. Select JSON as the Type.
  7. Right-click in the Request editor and select the MyUser variable.
  8. Select Variable as the Response type.
  9. Select the MyUser variable as the Value.
  10. Select Suspend job on error.
    Restful service activity to create user

Add an activity to review information

After the user is created, add an Ordinary activity on the Create User activity to view the information, and allow to corrections to the job to be entered.

  1. Enter Review as the Name.
  2. Add the following input variables and click Done.

    • MyUser.name

    • MyUser.Team

    • MyUser.id

    • MyUser.createdAt

  3. Add the following output variable and click Done.

    • MyUser.job

Add an activity to update user

To use a PUT request to update the job value that is held by reqRes, add an activity on the Review activity.

The user is uniquely identified by an ID, so that value must be passed as a parameter to the service.

  1. Enter Update User as the Name.
  2. Select Other > RESTful service as the Type.
  3. Select REQ as the Web service.
  4. In the URL parameters, enter users/ and then right-click and select MyUser.id.
  5. Select PUT as the Verb.
  6. Select JSON as the Type.
  7. Right-click in the Request editor and select the MyUser variable.
  8. Select Variable as the Response type.
  9. Select the MyUser variable as the Value.
  10. Select Suspend job on error.
    Restful service activity to update user

Add an activity to verify information

After the update is complete, to verify the information, add an Ordinary activity on the Update User activity.

  1. Enter Final Review as the Name.
  2. Add the following Input variables.

    • MyUser.name

    • MyUser.Team

    • MyUser.id

    • MyUser.createdAt

    • MyUser.job

    • MyUser.updatedAt

  3. Click Done.

Add an End node

Add an End node to the Final Review activity.

Your process will look similar to the following example.User demo process

Release the process

Click Release to release the process.

Congratulations! You have successfully created your solution to use Data objects in POST, GET and PUT operations. Continue to Test your solution.