Skip to main content

PluginInterface

Important

This C++ SDK uses outdated technology that limits your extension opportunities. We've built a new Platform SDK using Python and the latest open-source technology to deliver a vastly improved development experience. Go to Platform SDK to get started!

PluginInterface

The PluginInterface class is provided to allow the Alteryx Engine to communicate with your tool. Manually set the properties below, or use ImplementPluginInterface to manage the process if you are following the standard naming conventions.

Properties

handle

Contains a pointer to the object that exposes the required functions for your tool to be recognized by the AlteryxEngine.

void * handle;

pPI_AddIncomingConnection

Contains a pointer to a function that is called when the AlteryxEngine is adding an incoming data connection. Implementation returns a 1 to accept the connection or a 0 to reject the connection.

typedef long ( _stdcall * T_PI_AddIncomingConnection)(void * handle, const wchar_t *pIncomingConnectionType, const wchar_t *pIncomingConnectionName, IncomingConnectionInterface *r_IncConnInt); T_PI_AddIncomingConnection pPI_AddIncomingConnection

If accepted, use the IncomingConnectionInterface class to handle each of the incoming connections individually. If the tool needs pre-sorted data, call the PreSort function and accept the resulting IncomingConnectionInterface instead.

pPI_AddOutgoingConnection

Contains a pointer to a function that is called when the AlteryxEngine is adding an outgoing data connection. Implementation returns a 1 to accept the connection or a 0 to reject the connection.

typedef long ( _stdcall * T_PI_AddOutgoingConnection)(void * handle, const wchar_t *pOutgoingConnectionName, IncomingConnectionInterface *pIncConnInt); T_PI_AddOutgoingConnection pPI_AddOutgoingConnection;

Each output is given a unique name by the tool.

pPI_Close

Contains a pointer that is called before the tool object is destroyed that points to a function containing any cleanup that needs to be handled.

typedef void ( _stdcall * T_PI_Close)(void * handle, bool bHasErrors); T_PI_Close pPI_Close;

Close happens after all data finished flowing through all fields. If bHasErrors is True, you would typically skip final processing.

pPI_PushAllRecords

Contains a pointer to a function that is called when the AlteryxEngine expects the tool to provide all data records it holds. This only pertains to tools that have no upstream connection, such as an input tool.

typedef long ( _stdcall * T_PI_PushAllRecords)(void * handle, __int64 nRecordLimit); T_PI_PushAllRecords pPI_PushAllRecords;

Set the nRecordLimit parameter to:

  • A value less than 0 to indicate there is no limit.

  • 0 to indicate the tool is being configured and no records should be sent.

  • A value greater than 0 to push that number of records.

ImplementPluginInterface

ImplementPluginInterface

The ImplementPluginInterface class initializes a PluginInterface for a tool. This class assumes your tool adheres to the standardized naming conventions:

PI_AddIncomingConnection(const wchar_t* pIncomingConnectionType, const wchar_t* pIncomingConnectionName, IncomingConnectionInterface* r_IncConnInt) PI_AddOutgoingConnection(const wchar_t* pOutgoingConnectionName, IncomingConnectionInterface* pIncConnInt) PI_Close(bool bHasErrors) PI_PushAllRecords(__int64 nRecordLimit)

Because this is a templated class, you must specify the type when calling methods.

Methods

Init

Initialize a plugin interface.

static void Init(int nToolId, const EngineInterface * pEngineInterface, PluginInterface *r_pluginInterface, T_PI *pPluginInterface, bool bTakeOwnership)

nToolId: The ID of the tool calling the function.

pEngineInterface: A pointer to the Alteryxengine provided to the plugin's entry point.

r_pluginInterface: A pointer to the PluginInterface object to initialize.

pPluginInterface: An unmanaged pointer to the instance of your plugin.

bTakeOwnership: An option that determines if Alteryx is responsible for releasing the PluginInterface once processing is complete:

  • True: Alteryx is responsible.

  • False: Interface release is managed by the tool.