Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Custom Code device allows you to use C# or Visual Basic code to write your own device within the constraints of Connexion. This is useful if, for example, you need more flexible transform options than those offered in the standard HL7 Transform device.

Table of Contents
indent20px

Tip

It is also possible to write your own device using C# or Visual Basic. This is different than using the Custom Code device. If any of the following conditions apply to your organization, you may want to write your own device. If you do decide to write a device, it is recommended that you first use the Custom Code device to create the required logic, and then move that logic to your own device.

Add a Custom Code device in the same way you would add any other device. Stop the channel, open it for editing, and choose Custom Code Device from the drop-down.

<screen shot>

Using the Custom Code window

If you select the Custom Code device in the channel, you can launch the Custom Code window.

<screen shot>

This window contains several components:

  • Code Editor: Use this window to write the custom code for the device (in either C# or Visual Basic)
  • Auto-run: Use this option to turn the auto-run feature on or off. When Auto-run is on, your code is run after every successful compile and the Input Message (as shown in the Input Message pane), will be transformed. If your ProcessMessage method contains long-running or expensive operations, you will most likely want this feature turned off.
Note

When the auto-run feature is off, a new Run button is displayed. If your code is error-free, click this button to apply your code to the current Input Message.