Automation Workflow Activities Overview
Workflow Activities
Workflow activities provide the ability to automate software deployment processes by using workflows. The workflows can be initiated by compliance rules, actions or part of change management processes. Workflows allow the creation, update and deletion of assignment by changing properties like a rollout plan or add and remove devices.
The prerequisite for using this document and creating workflows is a good understanding of the Matrix42 Digital Workspace Platform and Workflows. To give you a first impression, we have included a step-by-step example at the end of this document, which allows users with only basic knowledge to get a good impression of the power of workflows and these activities.
Available Activities
The category in the activity browser is "SUEM Automation" with sub categories "Assignment", "Device" and "UEM Object".
The "GetPlatformInfosDistinctActivity" and "GetPackageAndPlatformInfosActivity" activities are for internal use only and should not be used in custom workflows.
Use of Expressions as parameters in activities
The activities require input and output parameters. Many of the parameters are provides by ASQL expressions. Those are used to retrieve the GUIDs of Assignments, Devices or UEM Objects (like software package or Tag) which should be updated or added/removed. The output is usually transferred via a variable from one activity to another.
The Query Analyzer, which is installed on the Matrix42 DWP server in the bin folder is very handy to create the expressions. Make sure to use " quotes in the activities for expressions but not in the Query Analyzer.
Examples of expressions are provided in the description of the activities below.
Description of Activities
Create Assignment
Creates a new assignment in the UEM assignments. The activity provides parameters to define the various settings like "UEM Agent distribution options", "Rollout plan" and a name and description. It is also possible to add devices and UEM objects to the assignment.
- Mandatory parameter is the name. Example: "Frankfurt" or "DE001".
- Optional parameters are set to default values if not provided.
- Optionally added Devices and UEM Objects are provided as lists of GUIDs.
For testing purposes, the list of GUIDs can be hard-coded, such as "new List(of GUID) from { {new Guid("f6f84541-f0c1-ed11-50b7-a4bb6d70540a")}, {new Guid("15024641-f0c1-ed11-50b7-a4bb6d70540a")} }". The date can also be hard-coded using VBScript's CDate() function, like "CDate("2023-03-14 12:49 AM")". - The organizational information can optionally provided by the GUID using an expression like "new Guid("816361E3-13E6-4B44-96A9-FB44C63A8E36")" of the object (SPSCostCenterClassBase, SPSLocationClassBase and SPSOrgUnitClassBase).
Update Assignment
Updates the parameters of an existing assignment and adds/removes devices and UEM Objects.
- Mandatory parameter for "Group ID" is the GUID of the assignment. The GUID can be retrieved by using the activity "Get Assignment ID by Name" or "Get Assignment IDs by Expression".
- Optional parameters are set to default values if not provided.
- Optionally adds or removes Devices and UEM Objects which are provided as lists of GUIDs.
- The organizational information can optionally provided by the GUID of the object (Cost Center, Location and Organizational Unit).
- The values in drop-down lists and checkboxes are explicitly set to the values in the activity and overwrite the current state. To not change the existing value choose "NULL" in the drop down. Make sure if a date is already given in the Assignment the validation will check if a date is in the past and throw an error. To prevent this provide also the dates with the update.
- Example dynamic date value: To set a date in one of the date fields (User can postpone until) you can use the expression "New Date.UtcNow.AddDays(7)".
- This will set the date to the current date plus 7 days from the time the WF runs.
- Example dynamic date value: To set a date in one of the date fields (User can postpone until) you can use the expression "New Date.UtcNow.AddDays(7)".
As only one GIUD is required as input parameter use "GetAssignmentIdsByExpressionActivity_AssignmentIds.first()" as an expression when getting a list of GUIDs from "Get Assignment IDs by Expression".
Delete Assignment
Deletes an existing assignment.
- Mandatory parameter for "Group ID" is the GUID of the assignment. The GUID can be retrieved by using the activity "Get Assignment ID by Name" or "Get Assignment IDs by Expression".
As only one GIUD is allowed as input parameter use "GetAssignmentIdsByExpressionActivity_AssignmentIds.first()" as an expression when getting a list of GUIDs from "Get Assignment IDs by Expression".
Get Assignment ID by Name
Retrieves the GUID of a single assignment by its name.
- Input is a string . Example:
- "Demo"
- Output is GUID of the assignment which matches the name. Use a variable with type "System.GUID" to transfer the GUID of the assignment to the "Update Assignment" activity.
Get Assignment IDs by Expression
Retrieves the GUIDs of assignments by an ASQL expression. Base CI is UEMGroupAssignmentType.
- Input is an ASQL expression. Examples:
- "RelatedSPSCommonClassBase.Location.Name='Global'"
- Retrieves GUIDs of all assignments which are associated to the location "Global".
- "RelatedUEMGroupAssignmentClass.Name LIKE 'Demo%'"
- Retrieves GUIDs of all assignments which names start with "Demo".
- "RelatedSPSCommonClassBase.Location.Name='Global'"
- Output is a list of GUIDs.
- To create a workflow variable as a list of GUIDs, use the "Create Variable" button in the "Select variable" pop-up window.
- To create a workflow variable as a list of GUIDs, use the "Create Variable" button in the "Select variable" pop-up window.
If only the first GUID should be used when wanting to hand over the output to an activity which expects a single GUID use variable.First().
Get Rollout Status of Assignment
Used to retrieve the installation status of devices for a given assignment or the overall rollout progress. The result is based on the installation status (see "Deployments -> Installation Status" in the UI).
- Input arguments (mandatory):
- Mandatory parameter for "Group ID" is the GUID of the assignment. The GUID can be retrieved by using the activity "Get Assignment ID by Name" or "Get Assignment IDs by Expression".
- Output:
- Activated devices: Number of activated devices for the assignment. Integer value.
- Assigned devices: Number of assigned devices for the assignment. Integer value.
- IDs of devices with all assigned objects installed: List of devices which have all assigned objects installed as Object Ids. Type IEnumerable<Guid>.
- IDs of devices with partly assigned objects installed: List of devices which have partly installed assigned objects as Object Ids.. Type IEnumerable<Guid>.
- IDs of devices with none assigned objects installed: List of devices which have none assigned objects installed as Object Ids.. Type IEnumerable<Guid>.
- Fully Complete: Rollout progress fully completed. Type Decimal.
- Partly Complete: Rollout progress partly completed. Type Decimal.
- Not started: Rollout progress not started: Type Decimal.
Get Device IDs by Expression
Retrieves the GUIDs of devices by an ASQL expression.
- Base CIs are:
- SPSComputerType for Empirum Packages.
- UEMAgentTemplateType for Empirum Agent Configurations.
- UEMPatchManagementGroupType for Empirum Patch Groups.
- UEMBootImageType for Empirum Boot Configurations.
- UEMHardwareDriverType for Empirum Hardware Driver.
- UEMOSSourceType for Empirum Operating System Sources.
- UEMOSLanguagePackType for Empirum Language Packs.
- UEMTagType for Silverback Tags.
- UEMApplicationType for Silverback Apps.
- Input is an ASQL expression. Examples:
- "RelatedSPSCommonClassBase.Location.Name='Global'"
- Retrieves GUIDs of all devices which are associated to the location "Global".
- "RelatedSPSComputerClassBase.Name like 'PCD1%'"
- Retrieves GUIDs of all assignments which names start with "PCD1"
- "RelatedSPSComputerClassBase.Name like 'FFM%' AND RelatedSPSCommonClassBase.Location.Name='Frankfurt'".
- All devices which name starts with "FFM" and are associated to the location "Frankfurt".
- "RelatedSPSComputerClassBase.Name like 'FFM%' AND RelatedSPSComputerClassBase.GroupAssignments[Name is NULL or Name <> 'Frankfurt']"
- All devices which name starts with "FFM" and are not part of the assignment "Frankfurt".
- "NOT RelatedSPSComputerClassBase.Name like 'FFM%' AND RelatedSPSComputerClassBase.GroupAssignments.Name = 'Frankfurt'"
- All devices which name not starts with "FFM" and are part of the assignment "Frankfurt".
- "RelatedSPSCommonClassBase.Location.Name='Global'"
- Output is a list of GUIDs. Use a variable like "GetDeviceIdsByExpressionActivity_DevicesIds" to transfer the GUIDs.
- To create a workflow variable as a list of GUIDs, use the "Create Variable" button in the "Select variable" pop-up window.
Get UEM Objects IDs by Expression
Retrieves the GUIDs of UEM Objects by an ASQL expression. Base in the CI UEMSoftwarePackageType.
- UEM Objects are filtered by the provided type (i.e. Software, Tag, OSSource or AgentConfiguration).
- Input is an ASQL expression. Examples:
- "RelatedUEMObjectClassBase.Name like '%Adobe%'"
- Retrieves GUIDs of all assignments which names contain "Adobe".
- "RelatedUEMObjectClassBase.Name like 'Adobe Systems Reader DC%' AND RelatedUEMObjectClassBase.Version = '20.1'"
- Retrieves GUIDs of all assignments which names start with "Adobe Systems Reader DC" and the exact version "20.1".
- "RelatedUEMObjectClassBase.Name like '%Adobe%'"
- Output is a list of GUIDs which can be handed over to other activities by a variable like "GetUEMObjectIdsByExpressionActivity_UEMObjectIds".
- To create a workflow variable as a list of GUIDs, use the "Create Variable" button in the "Select variable" pop-up window.
Add/Remove Objects to/from Assignment
Used to add UEM Objects to an assignment or remove UEM Objects from an assignment. This is useful when no other settings of an assignment should be changed.
- Required input is a list of GUIDs of UEM Ojbects which should be added or removed and the GUID of an assignment.
- The UEM Ojbect GUIDs can be retrieved by using the "Get UEM Object IDs by Expression" which hands over the variable "GetUEMObjectIdsByExpressionActivity_UEMObjectIds".
- The assignment GUID can be retrieved by the activity "Get Assignment ID by Name" or "Get Assignment IDs by Expression".
As only one GIUD is allowed as input parameter use "GetAssignmentIdsByExpressionActivity_AssignmentIds.first()" as an expression when getting a list of GUIDs from "Get Assignment IDs by Expression".
Add/Remove Devices to/from Assignment
Used to add devices to an assignment or remove devices from an assignment. This is useful when no other settings of an assignment should be changed.
- Required input is a list of GUIDs of devices which should be added or removed and the GUID of an assignment.
- The devices GUIDs can be retrieved by using the "Get Devices by Expression" which hands over the variable "GetDeviceIdsByExpressionActivity_DevicesIds".
- The assignment GUID can be retrieved by the activity "Get Assignment ID by Name" or "Get Assignment IDs by Expression".
As only one GIUD is allowed as input parameter use "GetAssignmentIdsByExpressionActivity_AssignmentIds.first()" as an expression when getting a list of GUIDs from "Get Assignment IDs by Expression".
Add/Remove Objects to/from Assignments
Used to add UEM Objects to multiple assignments or remove UEM Objects from multiple assignments.
- Required input is a list of GUIDs of UEM Ojbects which should be added or removed and a list of GUIDs of assignments.
- The UEM Ojbect GUIDs can be retrieved by using the "Get UEM Object IDs by Expression" which hands over the variable "GetUEMObjectIdsByExpressionActivity_UEMObjectIds".
- The assignment GUIDs can be retrieved by the activity "Get Assignment IDs by Expression".
Add/Remove Devices to/from Assignments
Used to add devices to multiple assignments or remove devices from multiple assignments.
- Required input is a list of GUIDs of devices which should be added or removed and a list of GUIDs of assignments.
- The devices GUIDs can be retrieved by using the "Get Devices by Expression" which hands over the variable "GetDeviceIdsByExpressionActivity_DevicesIds".
- The assignment GUIDs can be retrieved by the activity "Get Assignment IDs by Expression".
Get Installation Status of UEM Object for Device
Used to retrieve the status for a given device and object. The result is independent from the an assignment and based on the installation status (see "Deployments -> Installation Status" in the UI).
- Input arguments (mandatory):
- Device ID – (Guid) ObjectID of Computer device (Expression-ObjectID) [VB input - new Guid()].
- Object ID – (Guid) ObjectID of UEMObject (Expression-ObjectID) [VB input - new Guid()].
- Output:
- Installation Result – (nullable int) returns result of installation (if not exists returns null). Values based on pickup UEMObjectInstallationResultPickup.
- Installation Status – (nullable int) returns status of installation (if not exists returns null). Values based on pickup UEMObjectInstallationStatusPickup.
- Last Changed - (nullable DateTime) returns Date of last Status update (if not exists returns null).
Get Installation Status of Device
Used to retrieve the status for a given device and returns the UEM Objects which meet the criteria. The result is independent from the an assignment and based on the installation status (see "Deployments -> Installation Status" in the UI).
- Input arguments (mandatory):
- Device ID – (Guid) ObjectID of Computer device (Expression-ObjectID) [VB input - new Guid()].
- Installation Result – Pickup which represents Installation Result (UEMObjectInstallationResultPickup)
- Installation Status – Pickup which represents Installation Status (UEMObjectInstallationStatusPickup)
- UEM Object Type – Pickup which represents UEM Object Type (UEMObjectTypePickup)
- Output:
- UEM Object IDs – returns IEnumerable<Guid> which represents (Expression-ObjectID) of UEM Objects which matches criteria which was selected as input (for input Device)
Get Installation Status of UEM Object
Used to retrieve the status for a given UEM Object and returns the devices which meet the criteria. The result is independent from the an assignment and based on the installation status (see "Deployments -> Installation Status" in the UI).
- Input arguments (mandatory):
- Object ID – (Guid) ObjectID of UEMObject (Expression-ObjectID) [VB input - new Guid()].
- Installation Result – Pickup which represents Installation Result (UEMObjectInstallationResultPickup)
- Installation Status – Pickup which represents Installation Status (UEMObjectInstallationStatusPickup)
- Output:
- Device IDs – returns IEnumerable<Guid> which represents (Expression-ObjectID) of Devices which matches criteria which was selected as input (for input UEM Object).
Examples
Example 1: Replace Device or Object in Assignments
The example is based on a build in feature which allows the replacement of a device or object in multiple assignments. It is based on an Action in the UI and uses a wizard to gather the required information. The result is handed over to a workflow using the activity "Add/Remove Devices to/from Assignments" and "Add/Remove Objects to/from Assignments".
Example 2: Add new computer to Assignment
The example will add each new computer which name starts with FFM and is managed by Empirum to the Assignment “Frankfurt” automatically.
Example 3 - Automatically assign computers based on location
This example ensures that all devices which have the location "Frankfurt" are assigned to the Frankfurt Assignments but removes them if they do not belong to Frankfurt anymore.