How to retrieve Tenant and Workflow Settings in custom Workflow jobs

Vault Administrators without PowerShell skills have the possibility to customize Field mappings and other custom Workflow settings in the powerFLC Configuration Manager.

In the according Workflow job there are 2 variables available that contain the configured Fusion Lifecycle Tenant settings and the according Workflow settings.

Instead of having the settings hardcoded in your custom Workflow job, the configuration applied in the Configuration Manager can be retrieved using the following:

  • The Tenant Settings with your FLC credentials can be retrieved by using $tenant variable
  • The Workflow Settings require a Workflow entry to be configured with the same name as the according powerJobs Processor job and can be retrieved by using the $workflow variable

Get Tenant Settings

The Tenant Settings can be retrieved using $tenant variable and is directly available in all powerJobs Processor jobs.

This variable contains all the required information to connect to FLC:

Import-Module powerFLC$connected = Connect-FLC -Tenant $tenant.Name -ClientId $tenant.ClientId -ClientSecret $tenant.ClientSecret -UserId $tentant.SystemUserEmail

Get Workflow Settings

The $workflow variable contains all relevant information for the workflow that was configured in the Configuration Manager.

This variable is directly available in all powerJobs Processor jobs and only provides the Workflow settings for the according Workflow.

The $workflow.Name property can be used to retrieve the name of the configured Workspace and the $workflow.Settings property allows retrieving constant values for specific Workflow Settings:

if ($workflow.Settings.'Upload Item Attachments') {    $attachment = Add-FLCAttachment -Workspace $workflow.Workspace -ItemId 8684 -Path 'C:\Temp\Injection Molding Machine.dwf'}
 

The $workflow.Mappings property provides access to all the configured Field Mappings and provides the different Fusion Lifecycle Field names, Vault Property Names and Function names. 

The GetFlcProperties function can simply be used in order to create a Hashtable with all the configured Fusion Lifecycle Field names and the mapped Vault Property values for a specific Vault Entity:

$mappingName = "Item Field Mapping"$properties = GetFlcProperties $mappingName $itemAdd-FLCItem $flcItem = Add-FLCItem -Workspace 'Items and BOMs -Properties $properties