Configure the rraOrders Action Chain for KPI 1

  1. Click the Actions tab.
    The order-analysis Page Designer displays with the Actions tab outlined in red.
  2. Click load_KPI_1_data.
    On the Actions window, load_KPI_1_data is outlined in red.
    The Diagram tab opens.
    The Diagram tab window displays with the Start point.
  3. In the Actions palette under General, click Call REST and drag it under the Start point and over the + icon, then drop it.
    In the Actions palette under General, Call REST is outlined in red. On the canvas, Call REST is directly under the start and there is a Fire notification error under the failure path.

    With this configuration method, the failure path for the REST call is automatically handled for you.

  4. Configure the call REST action.
    1. In the Call REST Properties pane, click Select.
      The Call REST properties pane displays with Select outlined in red.
    2. In the Select Endpoint dialog box, expand Services.
    3. Expand fscmRest, and then expand rraOrders.
    4. Select GET /rraOrders.
      The Select Endpoint window displays, with Services, fscmRest, and rraOrders expanded and GET /rraOrders displaying.
    5. Click Select.
      In the Properties pane, the ID value automatically updates to reflect the selected endpoint.
      The Call REST Properties pane displays with the ID value automatically updated, outlined in red.
  5. To replace the Call REST action name with a more descriptive title, in the Label field, enter Fetch All Orders.
    The Call REST properties pane displays with Fetch All Orders in the Label field, outlined in red, and the label displaying on the canvas under Start, outlined in red.
  6. Replace the default get limit, which is in increments of 25, with a more reasonable limit for the KPI.
    1. If not already selected, select Fetch All Orders.
    2. In the Properties pane, under Input Parameters, click # limit.
    3. In the Assign Input Parameters dialog box, in the Target panel, select # limit.
    4. In the # uriParams.limit field at the bottom of the dialog box, enter 1000.
    5. Select the Static Content option if it isn't already selected.
      The Assign Input Parameters window displays with the # uriParams.limit field and the Static Content option outlined in red.
    6. Click Save.
  7. Configure the success path with the Assign Variables action.
    1. In the Actions pane, click Assign Variables and drag it under the success path and over the Return action, then drop it.
      Note: The Assign Variables action has an error icon and in the Assign Variables properties pane, the error tells you that you need at least one property because you haven't configured any properties yet.
    2. To replace the Assign Variables action name with a more descriptive title, in the Properties pane, Label field, enter Assign Total Number of Orders.
      The Actions pane displays with Assign Variables outlined in red, and the Properties pane, Label field is outlined in red with Assign Total Number of Orders entered.
    3. Next to Variables, click Assign.
      The Description window displays with Assign outlined in red.
    4. In the Assign Variables dialog box, in the Sources panel under Action Chain > Results, expand { } callRestGetallRraOrders and { } body.
    5. In the Target panel, under Page, expand [ ] kpisArray.
    6. Select { } item[i].
    7. In the text area at the bottom of the dialog box, under { } $page.variables.kpisArray[0] field, select the Expression option.
    8. In the Sources panel, click # count and drag it over the Target panel { } item[i] variable, then drop it.
      This expression should appear in the { } $page.variables.kpisArray[0] field. If it doesn't, copy this expression and paste it in the field: $chain.results.callRestGetallRraOrders.body.count.
      The Assign Variables window displays with the { } $page.variables.kpisArray[0] field and the Expression option outlined in red.
    9. Click Save.
  8. By default, the variable assignment applies to the entire array. Update it to apply to only the metric of KPI 1.
    1. On the Actions tab, click Code.
    2. In the assignVariablesKpisArray section, under parameters, change $page.variables.kpisArray to $page.variables.kpisArray[0].metric.
      The Actions tab displays with Code and $page.variables.kpisArray[0].metric in the assignVariablesKpisArray section outlined in red.
  9. To test the action chain, go to the Page Designer tab, and click Live.
    Under Total Number of Orders, the --- should be replaced with the number of orders. It takes some time for the information to appear. You might need to refresh the page to get the information to appear.
    The Page Designer tab displays with the Total Number of Orders section outlined in red.