Workflows

Workflows consist of two components: the Workflow Configuration within the Configuration Manager and the according powerJobs Processor job.

Configuration

When the Fusion Lifecycle tenant is configured properly, still this Tenant Settings have to be configured in the Vault Client in order to allow powerFLC Workflows to connected to Fusion Lifecycle.

Each Workflow requires its own configuration entry in the Configuration Manager with the same name as the associated Workflow Job.
For the Transfer Item BOMs workflow a default configuration gets delivered from coolOrange in the location %ProgramData%\coolOrange\powerJobs\Jobs\Sample.TransferItemBOMs.json.

In order to allow this Workflow to perform the actions with the correct Fusion Lifecycle user, the e-mail address of the Vault user that submitted the according job must be configured in the Vault User profile:

This same email address must be present for the Fusion Lifecycle User:


Jobs

For the moment only the Transfer Item BOMs workflow job gets delivered from coolOrange, with the purpose to help people getting started with creating their own workflows based on powerJobs Processor.
This sample covers the most common scenario for exchanging data between Vault and Fusion Lifecycle and is highly customizable.
We recommend to copy the sample workflow script and create your own Custom Workflow job, when you prefer to do additional customizations.

Make sure to start the powerJobs.exe at least once to make sure the workflow job types are synchronized and can be processed by powerJobs Processor.

Modules

Following powerShell script modules are delivered with powerFLC and installed in the powerJobs Processor module directory:

  • coolOrange.powerFLC.Workflows.MappingFunctions.psm1
  • coolOrange.powerFLC.Workflows.Common.psm1
  • coolOrange.powerFLC.Workflows.Extensions.psm1
  • coolOrange.powerFLC.Workflows.Async.psm1

coolOrange.powerFLC.Workflows.Common.psm1

Contains functions to simplify the workflow jobs.
Important functionalities:

  • Provides the $tenant variable that contains tenant connection information.
  • Provides the $workflow variable which supplies the configuration of the workflow associated with the currently executing job.

coolOrange.powerFLC.Workflows.MappingFunctions.psm1

Contains the functions that are used in the Field Mappings dialog.

Workflow trigger

In order to execute the Workflow Job on Vault lifecycle changes, each single Vault lifecycle state transition must be extended with the according Job Type matching the “Workflow Name”.
Following example configures the sample Sample.TransferItemBOMs job for Vault Item lifycle changes to a 'Released' state:

Afterwards when changing the state for a specific Vault Item, this will automatically queue the “Transfer Item BOMs” workflow job.

Alternatively the job can either be triggered within a custom powerEvents script by using the Add-VaultJob cmdlet and passing the required Item prameters:

$item = Get-VaultItem -Number 100018
$job = Add-VaultJob -Name "Sample.TransferItemBOMs" -Parameters @{"EntityId"=$item.Id;"EntityClassId"="Item"} -Description "Transfer Item BOMs for: $($item._Number)"
Also the Priority of the created Job can be configured. Jobs with higher priority will be executed first. The lower the number the higher the priority.

In order to configure the Workflow to be executed in a specific Interval, you can easily convert your Workflow Job into a time triggered job by creating a “{Workflow Name}.settings” file in the powerJobs Processor Jobs directory.
The job Priority can also be configured within this settings file.

Also in this section