Extend packages using plugins

With the introduction of plugins to certain activities, you will need to update an already installed package with an extension package. You define a plugin using a node in the WorkflowDefinition section that specifies the name of the assembly and the name of the interface:

<PluginAssembly>Assemblyname.dll</PluginAssembly> <PluginInterface>IUpdateMetaData</PluginInterface>

The Package Loader supports that you can extend existing packages by installing a package extension.

The package must include a new node named Extension in the XML definition. The Extension node specifies which package that the extension affects:

<PackageDefinition>
    <Name>CommunicationExtension</Name>
    <Extension>ExternalCommunication</Extension>
    <Version>19.1.1.0</Version>
    <Description>Package contains ExternalCommunication extensions.</Description>
 </PackageDefinition> 

When the Extension node is met, the specified version of the package is matched against the version specified. The two versions must identical for the extension package to load.

The package.xml may contain sections to add or modify the following sections:

  • <Assemblies>
  • <Assets>
  • <Forms>

The <Workflows> section only allows a small part of a WorkflowflowDefinition to be modified. The XAML part of the workflow cannot be modified so in order to identify a workflow, a new node named TypeName is specified, which together with the Version identifies the workflow. Also, it is possible to specify which dll contains the plugin. (The assembly must be added in the <Assemblies> section in order for the workflow to find it).

<WorkflowDefinition>
      <Version>19.1.1.0</Version>
      <TypeName>WorkZone.ExternalCommunication.SendSmartPost</TypeName>
      <PluginAssembly>WorkZone.FSMI.Plugin.dll</PluginAssembly>

In the <Processes> section <ProcessDefinition>, the following nodes can be modified:

  • Name
  • Description
  • DisplayOrder
  • DurationUnit
  • DefaultDuration
  • NearDuration
  • AccessCode
  • Access

The ProcessGuid is mandatory and must match the value of the original package.

Most important – it is possible to define more process parameters in the <Parameters> section.

<ProcessDefinition>
          <ProcessGuid>{23B9498E-BCA5-4746-98A0-71E03CD6963C}</ProcessGuid>
          <Parameters>
          <!—specify new parameters -->
          </Parameters>
        </ProcessDefinition>