Skip to main content

EngineInterface

Importante

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!

The EngineInterface class is provided to allow users to interface with the AlteryxEngine.

Methods

AllocateMemory

Allocates memory for use by a plugin; reserve for cases when you need large memory allocations. Returns the pointer to a buffer of allocated memory.

void * AllocateMemory(int nToolID, MemoryAllocatorInterface *pMI, size_t *pSize)

nToolId: The ID of the tool calling the function.

pMI: The interface that allocates the memory.

pSize: A pointer used to specify the size of the memory being allocated.

Use FreeMemory to free memory allocated with this method.

Use Requirements

Requires a MemoryAllocatorInterface structure to help manage allocation. To create this structure, implement a function in your interface with the signature:

long MI_ResetBufferLength(void *pOldMemoryBlock, void *pNewMemoryBlock, size_t newSize);

MI_ResetBufferLength should return 1 to accept the buffer, 2 to release it, and 0 to indicate a fatal error.

Use ImplementMemoryAllocatorInterface using this interface as a template.

CreateTempFileName

Creates a temporary file that is automatically deleted once processing finishes. Returns the full path of the created file.

const wchar_t * CreateTempFileName(const wchar_t *pExt=L"tmp")

pExt: The file type extension for the new file. By default, the extension type is "tmp".

CreateTempFileName2

Creates a temporary file with an option for automatic file deletion. Returns the full path of the created file.

const wchar_t * CreateTempFileName2(const wchar_t *pExt=L"tmp", int nOptions=0)

pExt: The file type extension for the new file. By default, the extension type is "tmp".

nOptions: The option that determines what happens to the temporary file.

  • 0: The file is automatically deleted at the end of processing.

  • 1: The tool is responsible for deleting the file.

FreeMemory

Frees memory that was previously allocated using AllocateMemory.

void FreeMemory(void *pBuffer)

pBuffer: A pointer to a buffer created with AllocateMemory.

GetInitVar

Provides access to user and system settings. Returns the value of a specified user or system setting.

const wchar_t * GetInitVar(const wchar_t *pVar)

pVar: The name of the user setting value to return. Valid values include:

  • TempPath: Returns the full path of the folder to use when creating temporary files.

  • RuntimeDataPath: Returns the full path of the RuntimeData folder from an Alteryx installation.

  • NumThreads: Returns the number of threads available.

  • DefaultDistanceUnits: Which distance units is set as the default, returns either Miles or Kilometers.

  • DefaultDir: Returns the full path to the default folder used when evaluating relative paths.

  • DisableBrowse: If Browse tools are disabled in Designer, returns either True or False.

  • Version: Returns the version of Alteryx running.

  • SerialNumber: Returns the serial number associated with the Alteryx installation.

  • OutputRecordCounts: If record counts are output at runtime, returns either True or False.

  • AllowDesktopInteraction: If the system can display dialog boxes to the user, returns either True or False.

  • ConvErrorLimit: Returns the number of conversion errors allowed before processing ends.

IsLicensed

Determines and reports if the tool is licensed. Returns non-zero if licensed.

int IsLicensed(const wchar_t *pDll, const wchar_t *pEntryPoint)

pDll: The name of the dll file for the tool.

pEntryPoint: The entry point for the tool.

OutputMessage

Notifies the Alteryx engine of messages generated by the tool. Returns 0 to continue processing and 1 to stop processing.

long OutputMessage(int nToolID, int nStatus, const wchar_t *pMessage)

nToolId: The ID of the tool calling the function.

nStatus: The type of message being sent.

pMessage: The text of the message being sent.

OutputToolProgress

Notifies the Alteryx engine and upstream tools of the tool progress. Returns 0 to continue processing and 1 to stop processing.

long OutputToolProgress(int nToolID, double dPercentProgress)

nToolId: The ID of the tool calling the function.

dPercentProgress: The percent completion for the tool. Valid values are decimals between 0.0 and 1.0.

Upstream tool's request progress using the UpdateProgress method from the IncomingConnectionInterface class.

If needed, your tool must manage requesting progress from downstream tools. Use the UpdateProgress method from the PluginOutputConnectionHelper class.

PreSort

Presort incoming data connections. Returns non-zero for success.

long PreSort(int nToolId, const wchar_t * pSortInfo, IncomingConnectionInterface *pOrigIncConnInt, IncomingConnectionInterface ** r_ppNewIncConnInt, PreSortConnectionInterface ** r_ppPreSortConnInt)

nToolId: The ID of the tool calling the function.

pSortInfo: An XML string that templates the fields to sort and filter by. The XML should be in the format below. If FieldFilterList is not specified, no filters are applied.

<SortInfo> <Field field="SortField1" order="Asc" /> <Field field="SortField2" order="Desc" /> ... </SortInfo> <FieldFilterList> <Field field="FilterField1" /> <Field field="FilterField2" /> ... </FieldFilterList>

pOrigIncConnInt: A pointer to the incoming connection being sorted.

r_ppNewIncConnInt: A pointer to the pointer of a new incoming connection that is created by the sort.

r_ppPreSortConnInt: A pointer to the pointer of the pre-sort tool created to perform the sort.

QueueThread

Queues a procedure for execution on a new thread.

void QueueThread(AlteryxThreadProc pProc, void *pData)

pProc: A pointer to the procedure being queued. The function pointed to must have the signature void Proc(void *pData).

pData: A pointer to the data being processed by the procedure.