The Invoke Custom Method action allows you to call a custom DLL and Create an Invoke Custom Method action for a workflow.
For example, you can use this action to modify your PM Compass database if it doesn't suit your company's needs. You can also use this action as a method of interacting with another outside application or system.
In addition, you can extend the existing Cobra Web Service calls using this method. The Invoke Web Services action is not intended for web services that require a login. Since the Cobra Web Services require a login, a sample process named Calculate Progress is included in the default database. For details, see Modify Invoke Custom Method to Call Cobra Web Services.
The Invoke Custom Method action is the recommended way to write custom code to be executed during a workflow. Whenever possible, this technique of extending Workflow should be used in lieu of the Invoke Web Service action.
To take full advantage of available functionality, the developer should inherit from WorkflowBaseClass – a class shipped with PM Compass in Deltek.PMCompass.WorkflowAPI.dll – that contains methods that allow the custom developer to participate in PM Compass' transactions. Participating in PM Compass’ transaction is the only way to prevent database locks when reading or updating data involved in the Save that triggered the workflow. The QueryData and ExecuteSQL methods are available when inheriting from WorkflowBaseClass to provide a safe way to query and update data in the PM Compass database without having to worry about where the current PM Compass database is or managing connections.
To create a custom DLL:
Create a Class Library project in Visual Studio.NET.
Add reference to Deltek.PMCompass.WorkflowAPI.dll and Deltek.PMCompass.Ancestors.dll located in the Web\bin directory under the PM Compass install directory.
Create a new class and inherit from WorkflowBaseClass.
Create any method(s) you need.
Compile your project.
Place resulting DLL in a directory called Workflow under the PM Compass install directory (create one if not there).
Your methods may have any number of arguments. The arguments to your methods should be of simple data types (for example, strings or integers).
If you compile your project in debug mode, you may copy the PDB file created during the compile to the Workflow directory as well. In case of errors, the presence of the PDB file will mean you will get more detailed error information, including line numbers in your stack trace.
When you select this action, PM Compass displays the Invoke Custom Method Configuration dialog box.
Create an Invoke Custom Method action for a workflow
Complete the process when a workflow fails
Modify Invoke Custom Method to Call Cobra Web Services