Processware Managed Code
Processware 2019 introduced a new feature commonly referred to as Managed Code as it extends the implementation of task logic from VbScript to using Microsoft's .NET Framework, and everything that comes with it - including the use of Microsoft's Visual Studio via an extension available on the Visual Studio Marketplace:
In addition to enabling the implementation of tasks, or task forms, this extension also enables the implementation of task forms for the sake of external client-related interaction via the Execution API (a topic not covered here).
The Processware Managed Code Visual Studio Extension
The Processware Managed Code Visual Studio Extension extends the standard Class Library (.NET Standard)
project type for C#.NET and Visual Basic.NET (currently the only supported .NET languages) creating a version of either populated accordingly.
Creating a new Processware Project
Add a new Processware Project to a solution:
Note
Be sure to select the Processware Project
and not the Processware Client Project
as the former creates engine related managed task forms while the latter is available for creating client-related task forms.
The Server Configuration tool window will be presented requesting configuration settings applicable across the project, including the physical path to a Processware Activity Server installation for referencing the appropriate FlowCentric.Engine.Contracts.dll
as well as directing the deployment of the project. The Server Address
and Authentication
sections are required for retrieving task form definitions from the associated installation to be implemented in the project.
Note
The user name (and password combination) must be that of an Administrator in Processware.
The following files form the artifacts of the Visual Studio Extension for managed task forms.
serverConfig.json
A JSON file containing the information captured via the Server Configuration tool window and used for retrieving task form definitions from a Processware Activity Server.
{
"Server": {
"Address" : "http://localhost/Server2019",
"UserName" : "[UserName]",
"Password" : "[Password]"
}
}
This file can be updated should either the password expire or be incorrect for the associated user, or if the server address is incorrect or changes.
C#/VB.NET Project File
The created project file for C#.NET and VB.NET differs only on the single language-related package reference that is based on the language type.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>[RootNamespace]</RootNamespace>
<AssemblyName>[AssemblyName]</AssemblyName>
<!-- Full Path to Installed Process Engine. -->
<ProcessEngineFullPath>C:\Program Files\FlowCentric\Processware 2019\Activity Server\Sites\Server2019\</ProcessEngineFullPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug' AND '$(ProcessEngineFullPath)' != ''">
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(ProcessEngineFullPath)bin\mgd\</OutputPath>
</PropertyGroup>
<ItemGroup>
<!-- C#.NET Project Type -->
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<!-- VB.NET Project Type -->
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
</ItemGroup>
<ItemGroup>
<Reference Condition="'$(ProcessEngineFullPath)' != ''" Include="FlowCentric.Engine.Contracts">
<HintPath>$(ProcessEngineFullPath)bin\FlowCentric.Engine.Contracts.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
</Project>
This is a standard Class Library (.NET Standard)
project type with the addition of:
- The
ProcessEngineFullPath
'variable' referencing the physical path to the Processware Activity Server installation provided using the Server Configuration tool window, - A
PropertyGroup
that omits theTargetFramework
sub-directory from the output ofDebug
builds and directs the build system to build directly to thebin\mgd\
folder of the Processware Activity Server installation, - An
ItemGroup
for grouping NuGet package references, populated with the language-specific package, and - An
ItemGroup
for grouping assembly references, populated with the required assembly,FlowCentric.Engine.Contracts
, that is found relative to the installed Processware Activity Server installation.
The Visual Studio Extension will not be used for the creation of Processware Projects in the remainder of the current set of articles since its purpose in this regard has been layed out here, and the Guidance will provide a cleaner and more coherent method for working with Processware Managed Code. The extension is still required for working with task forms.