This documentation supports the 22.1 version of BMC Helix Digital Workplace Basic and BMC Helix Digital Workplace Advanced. Icons distinguish capabilities available only for the Advanced and External license levels. For more information, see License-types-and-features.

Designing workflows for a repeatable group of questions


Design a workflow that collects answers to a repeatable group of questions in Comma Separated Values (CSV) or an object output format and send the answers for service fulfillment. Elements and actions available in the workflow designer depend on the connectors you have configured.

See a tutorial on how to create a workflow and a repeatable group of questions for a use case where people nominate fellow employees for a spot bonus, atUsing the Repeatable Group of Questions feature.

See a tutorial on how to create a workflow and a repeatable group of questions for a use case where the HR representative responsible for onboarding requests laptops for four new employees, atService fulfillment using a repeatable group of questions with CSV output.


To design a workflow to create multiple work orders, one for each set of responses to a repeatable group of questions

For a scenario where you need to provide laptops for new employees, design a workflow that uses the responses to a repeatable group of questions and creates multiple work orders for the procurement of laptops for these employees. When an Object output format is used, the workflow creates multiple work orders, one for each laptop requested.  

  1. Log in to the Catalog console and add a new workflow.
  2. In the Workflow Designer, create the following process input variables:
    1. all-instances: Object data type.
      From the Document Definition list, select the document definition for a repeatable group of questions. 
      You configure this document definition in BMC Helix Innovation Studio.
    2. sbcontext (Optional): Service broker context data type 
    3. instance: Object data type, local variable. Represents one instance of answers to the group of questions.
  3. Add a Sub-Process and configure the following properties:
    1. Loop Type: Parallel
    2. Loop Data Input: instances 
      Process variables > all-instances > instances

      Loop Data Input:instances
       parallel_loop_loopDataInput.png
    3. Input Data Item: instance (the object type local variable you created earlier)
  4. Add a Create Work Order with Identifiers element inside the Sub-Process.
  5. In the Input Map section for Create Work Order with Identifiers, fill in the following fields:

    Important

    Do not copy and paste the text values for parameters that require a text string input as the results may vary. You must manually enter the text values for parameters.

    Input Map parameter

     Field value

    Notes

    Connection ID (required)

    Remedy

    Information is available from connection category.

    Company Name

    Company

    Information is available from the service broker context.

    Customer login ID

    Custom Instance Property

    User who requires the service. The user must exist in BMC Helix Innovation Suite.

    1. From the Process variables list, select Instance > Custom Property

      Click here to expand...

      custom_property.png

    2. In ${processContext.instance.custom}, replace custom with login.value (where login is an alias). For example, ${processContext.instance.login.value}.

    Note: A JSONPath expression specifies a path to an element in a JSON structure. An alias is used in the JSONPath expression to access the answer to a question within an instance of a repeatable group of questions. The local variable instance references one set of answers to the repeatable group of questions. An alias references one of the questions within the group and .value gives access to the answer to the question. When you create a repeatable group of questions for this workflow in the Question Designer, you map an alias to a question in the repeatable group of questions.

    The following screenshot shows how you map an alias to a question in a repeatable group of questions

    alias_mapping.png

    Contact login ID (required)

    Custom Instance Property

    User who submitted the request. The user must exist in BMC Helix Innovation Suite.

    ${processContext.instance.custom}—Update custom with contactlogin.value (where contactlogin is an alias). For example, ${processContext.instance.contactlogin.value}.

    The following screenshot shows how you map an alias to a question in a repeatable group of questions

    Alias_to_question2.png

     

    Summary

    Service Name

    NA

    Correlation ID

    Process Correlation ID

    NA

    Description

    Service name

    NA
  6. Save the workflow.

To design a workflow with an optional repeatable group of questions

A repeatable group of questions can be optional. If a certain condition decides whether a repeatable group of questions should be visible to the user or not, the user might not be able to see or answer those questions.  When a user doesn't answer the questions, no instances are added. If the output format is JSON, an error occurs when a user submits a request without adding any instances of answers to the repeatable group. To avoid this issue, use an exclusive gateway that selects which workflow to execute depending on whether a user submits answers to the repeatable group. 

For example, let's say you need to provide equipment for a new employee. The repeatable group of questions are displayed to the user only if the user is a new employee. You add an exclusive gateway that selects the workflow that creates work orders only if the user responds to the repeatable group of questions.  

The exclusive gateway checks whether all-instances is NULL and works as follows:

  • If all-instances is not null, it creates work orders based on the instances.
  • If all-instances is null, it does not create any work orders.

 exclusive_gateway.png

 For more information about exclusive gateways, see Control-of-workflow-with-gateways.

To add an exclusive gateway

  1. Log in to the Catalog console and add a new workflow as described in To design a workflow to create multiple work orders, one for each set of responses to a repeatable group of questions.
  2. Add an exclusive gateway (image-2023-11-2_11-43-41.png) and connect it to the subprocess as shown in the image.

 Workflow_MIG_exclusive_gateway.png

  1. Define the condition for the flow that connects to the End event and configure the condition to evaluate to True if all-instances is null: 
    condition_for_flow.png

    Tip

    The sequence that connects to the subprocess is the default sequence flow.

  2. Save your workflow and close the workflow designer.
  3. Open the Questions Designer.
  4. Add a conditional question to check whether the requester is a new employee, add questions for the equipment, and click Save
    For more information, see Creating-a-repeatable-group-of-questions.
    Condition_MIG_requiredNotTrue.png

Results

When requesting the service, the user is prompted with the question "are you a new employee?"

  • If the user answers YES, a repeatable group of questions is displayed. After answering the questions, the user submits the request. For each instance of a repeatable group of questions and answers, a separate work order is created.  
  • If the user doesn't answer YES, the repeatable group of questions isn't shown to the user. The user does not answer the questions, and no work order is created.

Optional repeatable group of questions

Where to go from here

Creating-a-repeatable-group-of-questions

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*