Actions
Overview
Action is the User Interface element of the UUX, which is representing some operation which allowed to be run in the current execution context. The SolutionBuilder conciders multiple variables to define the execution context, like current UUX Application, or selected Management Area, selected Object or multiple Objects, and their statuses. Analyzing the Action configurations and current context, the SolutionBuilder dynamically renders the available Actions and various possible UUX UI Zones.
UI Zones
Actions are entities outlined in red in the screenshot below. As you can see, Actions can be located in different UI Zones:
- Floating Action Buttons;
- Side Panel (Preview Toolbar or Grid Context Menu);
- Application Toolbar (at the top of the screen).
Regardless of the defined Action UI Zone, the most popular actions can appear in the Dataset View Context menu (mouse right-click).
Predefined Generic Actions
There are certain predefined Actions in the platform which are available by default for each existing and newly created Configuration Item object.
Default generic actions are:
Visibility of predefined Actions is determined by:
- action settings and filtering conditions for the Configuration Item;
- User Role permissions for the Configuration Item objects modification;
- audience settings for the corresponding to the CI dialog.
Properties
General
Specifies the general settings of the Action
- Title, the action display string, which appears in UUX. The value is localizable
- Icon, the icon, associated with the Action
- Internal Name, unique name of the Action
Appearance
- Position, setups the ordering position of the Action. The Actions with smaller Position value appears on the top of the list (or first in Toolbar panel).
- Device Visibility, allows restricting the Action presence depending on the used device. In some particular cases, the Action could have sense only on Desktop decides, or otherwise around, only for Mobile. For instance, when Action triggers opening a massive wizard which cannot be displayed on Mobile, this action could be allowed only for Desktop, and for Mobile version, the Action could be either omitted or more lightweight version be introduced (in this case, the Action for Mobile device, be disabled for Desktop)
- Applications, defines the list of UUX Applications where the Action is allowed. For instance, for the same Object "Order" action "Withdraw" can be present for the End User in Self Service Portal, but it should not be present for Service Catalog Manager in Service Catalog.
If no Application is specified for the Action, the Action is available for all Applications
- UI Zones, specifies the UUX area where the Action appears. See the UI Zones
- Enabled, indicates whether the Action is enabled.
Implementation
The section allows configuring an operation that will be executed on clicking the Action in UUX.
- Run Workflow (the advantage of such an approach is that you can create workflows in the Workflow Studio without any coding by using the rich Workflow Activity Library. You can use any workflow with the Action Integration Context in actions. A workflow takes the list of selected objects as an input argument and can be used to process these objects in a sequence or as a batch)
- Service Operation (action can be configured to execute service and show confirmation text before. It is possible to change text to other than standard also it is possible to setup automatic related object dialog opening if the action succeeded)
- Open Create Dialog to create any new object available in the System.
Use Case Example: Create KnowledgeBaseArticle from a Problem, i.e. you create an Action available for Problem that opens the Create Dialog of the KBA.
- Open Edit Dialog for action's context to open the Edit dialog for editing an object relevant to context with the highest priority. You can also specify a dialog (optional) from the filtered list by chosen Configuration Item. In this instance, Type Filter 'Specified Only' as well as only one chosen Configuration Item are mandatory.
Use Case Example: Create Dialog with a single attribute with lower priority and use it in the action for changing a single attribute for the selected objects.
- Open Url
Opens the provided URL in a new browser window(tab). The following placeholder can be used in Url:
{object._id} - ID of the action context Object
{object._type} - Configuration Item of the action context Object;
{object._displayName} - Display String of the action context Object
Example: apps/workflow/{object._id}
- Run Wizard
Action starts the Wizard
- Custom Controller
The option can be used when no other Action implementation option does not meet the requirements. The "Custom Controller" implementation type allows assigning self-programmed AngularJs controller to Action. See "HOWTO: Implement Custom Controller for Action Implementation" for more details
Apply for Objects
The Section allows setup additional filtering criteria, which more accurately check the present execution context, to identify whether the Action is relevant and has to be displayed in UI.
Target, specifies the Object context required for the Action
- No Object Context (to execute business logic without any context),
- Single Object (to execute business logic in the context of one selected object),
- Multiple Objects (to execute business logic in the context of at least one selected object);
Filter by, define the filtering type of the selected Objects. In case the selected Objects are standard Configuration Items objects, the option "Configuration Item" need to be used.
Type Filter, specify the list of Object types (Configuration Items) for which the Action is applicable.
State Filter, Status Values, both attributes specifies the statuses of the context Objects for which the Action is relevant. Usually Status of the Object is represented by property SPSCommonClassBbase.Status, but the Status attribute can be changed in the appropriate Configuration Item Dialog, on Advanced Tabulator.
If the Statuses are configured for Action, the Action be visible only when the selected object(-s) status fits the Action configuration
Filter Javascript Expression, javascript logical expression which evaluates the selected objects, and only when expression result is true, the Action is displayed for the object, For more details read Actions Filter
Calculating Action Availability
The SolutionBuilder in runtime automatically decide which Action is available in current execution context, and as soon as the Context is changed, it immediately recalculates the actions and displays only the relevant, to avoid the End-User see and run an Action which is not applicable .
For each Action, enabled in Solution Builder, the System uses the following flow to decide whether the Action is permitted:
Action Javascript Filters
The Filtering JavaScript Expression box at the bottom of the New/Edit Action dialog allows users to specify additional filtering conditions for the Action. The Action will be available only when ALL the conditions specified in the Action dialog, including the one(s) provided in the Filtering JavaScript Expression, are met. The Filtering JavaScript Expression box allows for two contexts: current object and current user. The Action will be available only when the provided logical JavaScript Expression is true.
One and the same Action can be configured to appear in several places, for example, if you select the Side Panel UI Zone for an Action, it can be configured to be available both in the Toolbar of the Object Preview and in the context menu which appears when you right-click the object in the grid (Dataset View).
The Object Preview and Dataset View have different data sources. Provide a JavaScript Expression for each of the UI Zones where you need this Action to be displayed.
To understand better the structure of the $object which is used in Javascript Expression, you can type the expression
console.log($object) == 1
You can see the expression result in browser console (press F12)
Example
Please check the standard action "Accept" for Tickets as an example. The Action "Accept" has to be present for all not-closed Tickets, but should not be visible if the Ticket is already accepted by the current user.
Useful Links
- HOW-TO: Filter an Action based on a Data Attribute
- HOW-TO: Filter an Object Preview Action based on a Data Source
- HOW-TO: Use Custom Controller for Action Implementation
- Learn how to Set Audience for Actions.
- How to: Use Javascript Expression for hiding irrelevant UUX Actions
- Fleet Management Tutorial: Track On Map Action