Void Plug-Ins

The CardExchange® Producer plug-in framework has a hidden feature, which is the possibility to define a void plug-in. Void plug-ins offer two possibilities that are otherwise not possible:

  • Controlling when a .NET Function is executed
  • Using a single manual entry for multiple card items.

Plug-ins are only available in CardExchange ® Producer Business and Enterprise.

Description

A void plug-in is created by defining a plug-in that does not reference a real plug-in DLL. If CardExchange® Producer detects that no real plug-in is selected, it creates an internal plug-in with one input parameter, called "Definition", and one output parameter, called "Result". When executed, the plug-in copies the value of the input parameter to the output parameter.

By mapping a .NET function to the Definition parameter of a void plug-in, it is possible to combine the advantages of .NET Functions with the advantages of plug-ins, that is, you can develop your own .NET functions and you can still control when the function is executed by using the settings in the plug-in wizard.

By mapping the Definition parameter to a manual entry, you can use the result of a single manual entry in multiple mappings. That makes it possible to have a single manual entry whose value is both printed on the card and stored in the database.

For manual entries, you will often want the void plug-in to be executed whenever you call a preview. However, when the void plug-in is used in combination with a .NET function, you will often prefer to execute it during the print process only, or when clicking a button.

Example

To illustrate how void plug-ins work, we will create a card definition with a single manual entry that is both printed on the card and stored in the database.

1. To start, create a new card layout with a text object linked to a variable called "ManualText" and a data definition with a storage item called "ManualText".
2. Select "Do you want to use external functions or plug-ins" in the card-definition wizard and click the Edit button to configure the plug-in.
3. Add a plug-in called "ManualText" and type "void" in the DLL-file field. Then click Finish.

4. Click Next to go to the mappings window and map the visible item called "ManualText" to the plug-in output "ManualText.Result". Then map the plug-in input "ManualText.Definition" to "Enter manually".

5. Select the Storage items tab and map the storage item "ManualText" to the external function output.

6. Click Finish to close the card-definition wizard and open the manual-entry window. You will see, that there is a single manual entry.

7. Print the card. You will now see that the manual entry is stored in the database.

Other input sources can be used for Void Plug-ins, such as a print date or an environment variable. The point at which the plug-in is processed can then be controlled instead of always being processed at print time.