Use Multi Actions Technical Objects

As an application designer or story developer, you can use the Multi Actions technical object and related script APIs to let viewers run multi actions, set and read parameter values.

Prerequisites

Before you can use the multi actions technical object, there have to be multi actions already created.

Consider the following permissions and roles as well:
  • To create or edit a multi actions technical object, you need the permission to edit the analytic application or story.

  • To select a multi action in the Multi Actions Configuration side panel, you need the read permission for it.

  • To execute a multi action, viewers need the execute permission for it.

Context

Multi action can help users save time when they need to run multiple data actions in sequence, publish versions, run predictive scenarios or combine these operations. There're two ways for you to use this feature:
  • Using the Multi Action Trigger widget

    For how to add a multi action trigger to your analytic application or story and configure related settings, refer to Set Up Planning Triggers.

  • Using the Multi Actions technical object and related APIs

    You can do the following:
    • Setting parameter values of multi actions

    • Reading parameter values of multi actions

    • Executing multi actions

Procedure

  1. To add a multi actions technical object, in the Scripting section of the Outline panel, (for analytic applications) choose right next to Multi Actions, or (for optimized stories) choose Start of the navigation path Next navigation step  Multi ActionsEnd of the navigation path.

    The side panel Multi Actions Configuration opens.

  2. Under Multi Action, select one of the multi actions that have been created.

    You can see the Parameters section.

  3. Enter the values for the parameters, either by member selection or the default value set in the multi actions designer.
    Note
    • To let viewers execute a multi action successfully, you need to enter the values of all parameters, either in Multi Actions Configuration panel or via the API setParameterValue.

    • The design of the multi action itself can't be changed in Multi Actions Configuration, but you can adjust it by setting parameter values here.

  4. Select Done.
  5. After adding the technical object, you can leverage the following APIs to work with multi actions in your application or story:
    • Executing multi actions

      • As a blocking operation. Other scripts won't be running until the multi action execution is complete.
        Code Syntax
        execute(): MultiActionExecutionResponse
        The API returns the execution status, either success, error or running.
      • As a nonblocking operation. Other scripts can be running at the same time without waiting for the multi action execution to complete.
        Code Syntax
        executeInBackground(executionName: string): MultiActionBackgroundExecutionResponse
        The API returns the execution status, either accepted or error, and a unique execution ID.
        In this case, the onExecutionStatusUpdate event of multi actions technical object can be called when the execution status changes:
        Code Syntax
        // Called when an asynchronous Multi Action execution changes its status. The new status parameter value can be Success, Error or Running.
        onExecutionStatusUpdate(status: MultiActionExecutionResponseStatus, executionId: string, executionName: string): void
        
    • Getting parameter values

      Code Syntax
      getParameterValue(id: string): MultiActionParameterValue
    • Setting parameter values

      Code Syntax
      setParameterValue(id: string, value: string | string[] | MultiActionParameterValue JSON | number): void