This documentation supports the 25.4 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 the License types and features topic. To view an earlier version, select the version from the Product version menu.

 

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, at Using 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, at Service fulfillment using a repeatable group of questions with CSV output.

To design a workflow to create a single work order

For a scenario where you need to submit multiple related requests together, such as requesting laptops for several employees as a single task, design a workflow that uses the responses to a repeatable group of questions and creates one work order. When the Comma Separated Values output format is used, the workflow aggregates all responses and attaches them to the work order as a CSV file.

  1. Log in to the Catalog console and add a new workflow.
  2. In the Workflow Designer, create the following process input variables: 
    • Attachment: Specify this variable as a Text type variable. This variable will hold the answers to questions.
    • SB Context: Specify this variable as a Service Broker Context type variable. This variable contains information and details automatically generated from a service request.  
  3. From the workflow element palette, add the Create Work Order with Identifiers action to create a work order.
    The Create work order with identifiers action has the same parameters as a Create work order, but includes additional output Identifier fields that might be necessary to be referenced in other actions in a workflow.
    rtaImage.jpg
  4. Link the action to the workflow Start and End activities.
    rtaImage (1).jpg
  5. Select the Create Work Order with Identifiers action.
  6. Map the process input variables as shown in the following table, so that the information that the user enters in the questionnaire is passed to the workflow:
    Input Map parameterField value
    Connection ID (required)Remedy
    Contact login ID (required)SB Context > Requested by user > Login Name
    Customer login IDSB Context > Requested for user > Login Name
    SummarySB Context > Service > Service Name
    Correlation IDGeneral > Process Correlation ID
    Attachments

    Attachment

    (The process input variable created earlier)

  7. Save the workflow.

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 handle multiple related requests separately, such as providing laptops for several employees as individual fulfillment tasks, design a workflow that uses the responses from a repeatable group of questions and creates multiple work orders. When the Object output format is used, the workflow processes each response independently and creates one work order for each response.

  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:

    Warning

    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 that creates multiple work orders 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 Object, 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
  3. 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
    The sequence that connects to the subprocess is the default sequence flow.
  4. Save your workflow and close the workflow designer.
  5. Open the Questions Designer.
  6. 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*

BMC Helix Digital Workplace 25.4