Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I am trying to have the user-defined functions in Functions > user defined functions which I am unable to do.
I followed the documentation steps and below are some attached code
I used vscode to compile and generate MyTransformation.dll and MyTransformation.so files which I copy pasted manually in the path (C:\Program Files\Attunity\Replicate\addons\samples\MyTransformation)
and the addons_def.json.sample looks like below
and the MyTransformation.c looks like below in the path (C:\Program Files\Attunity\Replicate\addons\samples\MyTransformation)
I also restarted the replicate service after registering the file path. It still doesnt show any function.
Any suggestion or guidance here is appreciated. thanks.
#addons
Hi,
Thank you for the post to the Forums. Here are some helpful steps along with the Documentation for the addon and implementation. Did you run the registration of the addon.def as shown and step 4 as this is how it gets loaded to the UI Replicate Console Functions user defined I believe.
typedef int AR_ADDON_INIT_FUNC(AR_ADDON_CONTEXT *context); |
All the types and prototypes are defined at 'ar_addon.h'
{ "addons": [{ "name": "MyTransformation", "type": "STARTUP", "lib_name": "MyTransformation.dll", "init_function": "my_transformation_init_func" }] } |
transdef = GET_AR_AO_TRANSFORMATION_DEF(); transdef->displayName = "prefix_with(X, Y)"; transdef->functionName = "prefix_with"; transdef->description = "prefix_with adds the prefix <Y_> to a given string X"; transdef->func = trans_prefix_with; transdef->nArgs = 2; AR_AO_REGISRATION->register_user_defined_transformation(transdef); |
Bill
HI,
Please try to uncomment lib_path(.dll location) in your addon_def.json
Thanks
You need to remove the // before lib_path if you use a non-standard path.
But it may be easier to just use the standard path : MyTransformation\MyTransformation.dll
Doe NOT use the 'samples' path.
And I don't think you need the \\, just a \ will do if you anchor your path - without anchor it will be relative to the installation directory.
Hein.
Hi,
I tried to follow the steps which you mentioned. But still not able to fix. Here is my json file .
I have compiled and got these files and pasted in the path below:
In the documentation it is written that dll file is automatically generated, I am not clear on this part. I have compiled the files manualy using the gcc command and added all the file in the path mentioned. Do correct me if the approach which I have taken is incorrect.
The documentation is bit ambiguous in nature and makes few assumptions that the user is aware of. Do forgive me for any misunderstandings as I am a newbie to Qlik and only getting used to it.
Chaithra
Hi,
Thank you for the post to the Forums. Here are some helpful steps along with the Documentation for the addon and implementation. Did you run the registration of the addon.def as shown and step 4 as this is how it gets loaded to the UI Replicate Console Functions user defined I believe.
typedef int AR_ADDON_INIT_FUNC(AR_ADDON_CONTEXT *context); |
All the types and prototypes are defined at 'ar_addon.h'
{ "addons": [{ "name": "MyTransformation", "type": "STARTUP", "lib_name": "MyTransformation.dll", "init_function": "my_transformation_init_func" }] } |
transdef = GET_AR_AO_TRANSFORMATION_DEF(); transdef->displayName = "prefix_with(X, Y)"; transdef->functionName = "prefix_with"; transdef->description = "prefix_with adds the prefix <Y_> to a given string X"; transdef->func = trans_prefix_with; transdef->nArgs = 2; AR_AO_REGISRATION->register_user_defined_transformation(transdef); |
Bill
Thanks Bill for the response.
Is there any implementation notes or references on how to create a shared library in C ? sorry for being such a noob.
Is there any plan to extend the feature for python ?
Hello,
This is a video which contains an explanation about shared libraries in C and how to create them on linux, i don't know which OS you are on but i hope this at least helps, and if you have windows maybe you can convert the process.
Write Better Code! | How to Create Shared Libraries in C/C++ - YouTube
Sorry i can't do more on this one im more proficient in JavaScript