I need a customization for an item type, so i create a dynamic link library to achive that with using post action (USER_item_created). I want to get the created item tag and do something on it, but the item tag and item revision tag returns NULL.
Here is the sample code..
extern int ITK_user_main(int argc, char * argv)
extern DLLAPI int CUSTOM_method_register_callbacks()
CUSTOM_register_exit("CUSTOM_method", "USER_item_created", (CUSTOM_EXIT_ftn_t)CUSTOM_method_call);
extern DLLAPI int CUSTOM_method_call(int *decision, va_list args)
tag_t tItem = NULLTAG;
tag_t tItemRev = NULLTAG;
char * cItemID = va_arg(args, char *);
char * cItemRev = va_arg(args, char *);
printf("Item ID: %s\n", cItemID); // Item ID gets correctly
printf("Item Revision : %s\n", cItemRev); // Item Revision gets correctly
ITEM_find_item(cItemID, &tItem); // Item Tag is NULL ?
ITEM_find_revision(cItemID, cItemRev, &tItemRev); // Item Revision Tag is NULL ?
if (tItem != NULLTAG)
*decision = ONLY_CURRENT_CUSTOMIZATION;
*decision = NO_CUSTOMIZATION;
Do you want to just add a post action on item creation? or is there any special requirement which can be fulfilled by user exits?
can you explain the requirement?
I will create some dataset after creating new item revision (data will come other system) and some changes on item revision relations. I research doing all that on post action, but it requires custom codes on BMIDE. So I want to try USER libs. According to the documentation it sould be possible.
In documentation it says:
USER_EXITS_API int USER_item_created ( const char * item_id, const char * revision_id )
This USER EXIT ITK provides a hook point for customers to plug the customization codes into the item creation. It is called at the end of successful item creation.
item_id (I) Id assigned to newly created item
revision_id (I) Revision id assigned to the newly created item revision
try this, without writing single line you can do it.. if only need to is to create dataset upon item creation
We already use createObjects extension for some customizations, but I need dll for some reasons. We will start multiple process after item created. Thanks for your reply. I think we should learn how to write custom codes on BMIDE.