|
|
#include "raycus_itk.h"
|
|
|
#include "handler.h"
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
/*
|
|
|
标准的注册供流程调用服务handler的入口
|
|
|
*/
|
|
|
|
|
|
extern "C" {
|
|
|
#endif
|
|
|
//此函数必须有规范的写法,必须以dll的名称加上"_"开头
|
|
|
DLLAPI int ld_itk_c_register_callbacks()
|
|
|
{
|
|
|
int ifail = ITK_ok;
|
|
|
ITKCALL(ifail = CUSTOM_register_exit("ld_itk_c", "USERSERVICE_register_methods",
|
|
|
(CUSTOM_EXIT_ftn_t)K_register_methods));
|
|
|
fprintf(stdout, "ld_itk_c register USERSERVICE_custom_register_methods complete\n");
|
|
|
|
|
|
|
|
|
|
|
|
ITKCALL(ifail = CUSTOM_register_exit("ld_itk_c", "USER_gs_shell_init_module",
|
|
|
(CUSTOM_EXIT_ftn_t)K_register_handlers));
|
|
|
fprintf(stdout, "ld_itk_c register USERSERVICE_custom_register_handlers complete\n");
|
|
|
return ifail;
|
|
|
}
|
|
|
#ifdef __cplusplus
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
extern DLLAPI int K_register_handlers(int *decision, va_list args)
|
|
|
{
|
|
|
int ifail = ITK_ok;
|
|
|
|
|
|
//移植105项目handler:提交流程检查指定审批节点是否都指派审批人员
|
|
|
ifail = EPM_register_action_handler("EPMC_check_process_member", "EPMC check process member handler",
|
|
|
(EPM_action_handler_t)EPMC_check_process_member);
|
|
|
if (ifail == ITK_ok)
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler EPMC_check_process_member completed!\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler EPMC_check_process_member failed %d!\n", ifail);
|
|
|
}
|
|
|
|
|
|
//LD根据问题类别指派责任人
|
|
|
ifail = EPM_register_action_handler("LD_AutoAssign", "LD_AutoAssign",
|
|
|
(EPM_action_handler_t)LD_AutoAssign);
|
|
|
if (ifail == ITK_ok)
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler LD_AutoAssign completed!\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler LD_AutoAssign failed %d!\n", ifail);
|
|
|
}
|
|
|
|
|
|
//LY根据问题类别指派责任人
|
|
|
ifail = EPM_register_action_handler("LY_AutoAssign", "LY_AutoAssign",
|
|
|
(EPM_action_handler_t)LY_AutoAssign);
|
|
|
if (ifail == ITK_ok)
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler LY_AutoAssign completed!\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler LY_AutoAssign failed %d!\n", ifail);
|
|
|
}
|
|
|
|
|
|
//流程启动时根据属性值和配置转义为TC人员到流程节点上
|
|
|
ifail = EPM_register_action_handler("Connor_ChangeItemNotify_AssignUser", "Connor_ChangeItemNotify_AssignUser",
|
|
|
(EPM_action_handler_t)Connor_ChangeItemNotify_AssignUser);
|
|
|
if (ifail == ITK_ok)
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler Connor_ChangeItemNotify_AssignUser completed!\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler Connor_ChangeItemNotify_AssignUser failed %d!\n", ifail);
|
|
|
}
|
|
|
|
|
|
//流程不包含责任人就提升
|
|
|
ifail = EPM_register_action_handler("LD_ElevateTask", "LD_ElevateTask",
|
|
|
(EPM_action_handler_t)LD_ElevateTask);
|
|
|
if (ifail == ITK_ok)
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler LD_ElevateTask completed!\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
fprintf(stdout, "Registering action handler LD_ElevateTask failed %d!\n", ifail);
|
|
|
}
|
|
|
|
|
|
//Connor_Review_Person
|
|
|
ITKCALL(ifail = EPM_register_action_handler("Connor_Review_Person", "", (EPM_action_handler_t)Connor_Review_Person));
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:Connor_Review_Person\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:Connor_Review_Person\n", ifail);
|
|
|
}
|
|
|
|
|
|
//Connor_allow_Workflow
|
|
|
ITKCALL(ifail = EPM_register_action_handler("Connor_allow_Workflow", "", (EPM_action_handler_t)Connor_allow_Workflow));
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:Connor_allow_Workflow\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:Connor_allow_Workflow\n", ifail);
|
|
|
}
|
|
|
|
|
|
//LD_FormAttrToExcel
|
|
|
ifail = EPM_register_action_handler("LD_FormAttrToExcel", "", (EPM_action_handler_t)LD_FormAttrToExcel);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_FormAttrToExcel\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_FormAttrToExcel\n", ifail);
|
|
|
}
|
|
|
|
|
|
//LD_ECN01_SetCICNFormProperty
|
|
|
ifail = EPM_register_action_handler("LD_ECN01_SetCICNFormProperty", "", (EPM_action_handler_t)LD_ECN01_SetCICNFormProperty);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_ECN01_SetCICNFormProperty\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_ECN01_SetCICNFormProperty\n", ifail);
|
|
|
}
|
|
|
//Connor_SetECNTaskNodes
|
|
|
ifail = EPM_register_action_handler("Connor_SetECNTaskNodes", "", (EPM_action_handler_t)Connor_SetECNTaskNodes);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:Connor_SetECNTaskNodes\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:Connor_SetECNTaskNodes\n", ifail);
|
|
|
}
|
|
|
//Connor_Check_ECN_GYReview_Person
|
|
|
ifail = EPM_register_action_handler("Connor_Check_ECN_GYReview_Person", "", (EPM_action_handler_t)Connor_Check_ECN_GYReview_Person);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:Connor_Check_ECN_GYReview_Person\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:Connor_Check_ECN_GYReview_Person\n", ifail);
|
|
|
}
|
|
|
//LD_515_SetCICNFormProperty
|
|
|
ifail = EPM_register_action_handler("LD_515_SetCICNFormProperty", "", (EPM_action_handler_t)LD_515_SetCICNFormProperty);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_515_SetCICNFormProperty\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_515_SetCICNFormProperty\n", ifail);
|
|
|
}
|
|
|
//LD_PartCompFLAG
|
|
|
ifail = EPM_register_action_handler("LD_PartCompFLAG", "", (EPM_action_handler_t)LD_PartCompFLAG);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_PartCompFLAG\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_PartCompFLAG\n", ifail);
|
|
|
}
|
|
|
|
|
|
//LD_SendDJJDD_To_MES
|
|
|
ifail = EPM_register_action_handler("LD_SendDJJDD_To_MES", "", (EPM_action_handler_t)LD_SendDJJDD_To_MES);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_SendDJJDD_To_MES\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_SendDJJDD_To_MES\n", ifail);
|
|
|
}
|
|
|
|
|
|
//UpgradeTask
|
|
|
ifail = EPM_register_action_handler("UpgradeTask", "", (EPM_action_handler_t)UpgradeTask);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:UpgradeTask\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:UpgradeTask\n", ifail);
|
|
|
}
|
|
|
|
|
|
|
|
|
//LD_PartChange
|
|
|
ifail = EPM_register_action_handler("LD_PartChange", "", (EPM_action_handler_t)LD_PartChange);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_PartChange\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_PartChange\n", ifail);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//LD_SendECRECN_ToSAPMES
|
|
|
ifail = EPM_register_action_handler("LD_SendECRECN_ToSAPMES", "", (EPM_action_handler_t)LD_SendECRECN_ToSAPMES);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_SendECRECN_ToSAPMES\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_SendECRECN_ToSAPMES\n", ifail);
|
|
|
}
|
|
|
|
|
|
//LD_GYLXFrozen
|
|
|
ifail = EPM_register_action_handler("LD_GYLXFrozen", "", (EPM_action_handler_t)LD_GYLXFrozen);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_GYLXFrozen\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_GYLXFrozen\n", ifail);
|
|
|
}
|
|
|
|
|
|
//填写完成时间
|
|
|
|
|
|
ifail = EPM_register_action_handler("LD_CompletionDate", "", (EPM_action_handler_t)LD_CompletionDate);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_CompletionDate\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_CompletionDate\n", ifail);
|
|
|
}
|
|
|
|
|
|
|
|
|
//填写任务分派时间
|
|
|
ifail = EPM_register_action_handler("LD_TaskAssignmentDate", "", (EPM_action_handler_t)LD_TaskAssignmentDate);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:LD_TaskAssignmentDate\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:LD_TaskAssignmentDate\n", ifail);
|
|
|
}
|
|
|
//(ifail = EPM_register_action_handler("Supor_signoff_rev", "将审签信息记录到表单上", (EPM_action_handler_t)Connor_signoff_rev));
|
|
|
//if (ifail == 0)
|
|
|
//{
|
|
|
// printf("Registering action handler Supor_signoff_rev success\n");
|
|
|
//}
|
|
|
//else
|
|
|
//{
|
|
|
// printf("Registering action handler Supor_signoff_rev failed\n");
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//测试handler
|
|
|
ITKCALL(ifail = EPM_register_action_handler("TEST", "TEST", (EPM_action_handler_t)TEST));
|
|
|
if (ifail == ITK_ok)
|
|
|
{
|
|
|
printf("register TEST success \n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
printf("register TEST failed \n");
|
|
|
}
|
|
|
|
|
|
//自动发邮件
|
|
|
(ifail = EPM_register_action_handler("SH_PLM_Email", "SH_PLM_Email", (EPM_action_handler_t)SH_PLM_Email));
|
|
|
if (ifail == 0) {
|
|
|
printf("Registering action handler SH_PLM_Email successful\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("Registering action handler SH_PLM_Email failed %d\n", ifail);
|
|
|
}
|
|
|
|
|
|
//创建后操
|
|
|
METHOD_id_t mth_tag;
|
|
|
ifail = METHOD_find_method("ItemRevision", ITEM_deep_copy_msg, &mth_tag);//参数1:类型,支持原生和客制化的;参数2:操作类型
|
|
|
if (mth_tag.id != 0) {
|
|
|
ifail = METHOD_add_action(mth_tag, METHOD_post_action_type, reviseDesignPost, NULL);//参数2:执行操作的时刻,支持前操作和后操作
|
|
|
fprintf(stdout, "regist reviseDesignPost post_action successfully \n");
|
|
|
}
|
|
|
else {
|
|
|
fprintf(stdout, "regist reviseDesignPost post_action failed \n");
|
|
|
}
|
|
|
|
|
|
|
|
|
//前操作
|
|
|
//创建后操
|
|
|
//(ifail = METHOD_find_method("ItemRevision", ITEM_create_rev_msg, &mth_tag));//参数1:类型,支持原生和客制化的;参数2:操作类型
|
|
|
//(ifail = METHOD_find_method("Item", ITEM_create_msg, &mth_tag));//参数1:类型,支持原生和客制化的;参数2:操作类型
|
|
|
//if (mth_tag.id != 0) {
|
|
|
// (ifail = METHOD_add_action(mth_tag, METHOD_post_action_type, Connor_CreateItemPost, NULL));//参数2:执行操作的时刻,支持前操作和后操作
|
|
|
// fprintf(stdout, "regist Connor_CreateItemPost post_action successfully !\n");
|
|
|
//}
|
|
|
//else {
|
|
|
// fprintf(stdout, "regist Connor_CreateItemPost post_action fiald !\n");
|
|
|
//}
|
|
|
|
|
|
|
|
|
METHOD_find_method("ItemRevision", "IMAN_save", &mth_tag);
|
|
|
if (mth_tag.id != 0) {
|
|
|
METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)Connor_ItemRevision_Save, NULL);
|
|
|
METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)Connor_checkItem_unique, NULL);//检查对象属性唯一性校验
|
|
|
printf("注册ItemRevision函数成功!\n");
|
|
|
}
|
|
|
METHOD_find_method("Item", "IMAN_save", &mth_tag);
|
|
|
if (mth_tag.id != 0) {
|
|
|
METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)Connor_checkItem_unique, NULL);//检查对象属性唯一性校验
|
|
|
printf("注册[检查对象属性唯一性校验]函数成功!\n");
|
|
|
}
|
|
|
|
|
|
ITKCALL(ifail = EPM_register_rule_handler("LY_CheckItem", "流程目标对象类型匹配", (EPM_rule_handler_t)rule_handler_LY_CheckItem));
|
|
|
if (ifail == ITK_ok) {
|
|
|
fprintf(stdout, "Registering rule_handler_LY_CheckItem complete!\n");
|
|
|
}
|
|
|
else {
|
|
|
fprintf(stdout, "Registering rule_handler_LY_CheckItem failed!\n");
|
|
|
}
|
|
|
|
|
|
//子发布状态
|
|
|
(ifail = EPM_register_action_handler("LY_ChildIsRelease", "LY_ChildIsRelease", (EPM_action_handler_t)XY_ChildIsRelease));
|
|
|
if (ifail == 0) {
|
|
|
printf("Registering action handler LY_ChildIsRelease successful\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("Registering action handler LY_ChildIsRelease failed %d\n", ifail);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//子发布状态
|
|
|
(ifail = EPM_register_action_handler("LY_ChildIsRelease", "LY_ChildIsRelease", (EPM_action_handler_t)XY_ChildIsRelease));
|
|
|
if (ifail == 0) {
|
|
|
printf("Registering action handler LY_ChildIsRelease successful\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("Registering action handler LY_ChildIsRelease failed %d\n", ifail);
|
|
|
}
|
|
|
|
|
|
//依据对象类型提取其下特定版本/状态对象
|
|
|
(ifail = EPM_register_action_handler("LY_ChildIsPickUp", "", (EPM_action_handler_t)LY_ChildIsPickUp));
|
|
|
if (ifail == 0) {
|
|
|
printf("Registering action handler LY_ChildIsPickUp successful\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("Registering action handler LY_ChildIsPickUp failed %d\n", ifail);
|
|
|
}
|
|
|
|
|
|
//力源
|
|
|
ifail = EPM_register_action_handler("F6_MEP_Merge", "", (EPM_action_handler_t)F6_MEP_Merge);
|
|
|
if (ifail == 0) {
|
|
|
printf("注册操作处理程序成功:F6_MEP_Merge\n");
|
|
|
}
|
|
|
else {
|
|
|
printf("注册操作处理程序失败[%d]:F6_MEP_Merge\n", ifail);
|
|
|
}
|
|
|
|
|
|
return ifail;
|
|
|
}
|
|
|
|
|
|
int Connor_open_bypass(void* returnValue)
|
|
|
{
|
|
|
POM_AM__set_application_bypass(true);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
int Connor_close_bypass(void* returnValue)
|
|
|
{
|
|
|
POM_AM__set_application_bypass(false);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
extern DLLAPI int K_register_methods()
|
|
|
{
|
|
|
int ifail = ITK_ok;
|
|
|
METHOD_id_t mth_tag;
|
|
|
int
|
|
|
status = ITK_ok,
|
|
|
numberOfArguments = 0,
|
|
|
returnValueType = USERARG_STRING_TYPE,
|
|
|
*argumentList = NULL;
|
|
|
USER_function_t functionPtr;
|
|
|
|
|
|
//修订
|
|
|
//{
|
|
|
// ifail = METHOD_find_method("ItemRevision", ITEM_deep_copy_msg, &mth_tag);
|
|
|
// if (mth_tag.id != 0) {
|
|
|
// METHOD_add_action(mth_tag, METHOD_pre_action_type, ML_ItemRevPreUpdate, NULL);
|
|
|
// printf("注册ItemRevision函数成功!\n");
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
//ifail = METHOD_find_method("ItemRevision", "ITEM_deep_copy", &mth_tag);
|
|
|
//if (mth_tag.id != 0) {
|
|
|
// ifail = METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)CONNOR_REVISE_CLEAR_FORM, NULL);
|
|
|
// if (ifail == 0) {
|
|
|
// printf("Registering method CONNOR_REVISE_CLEAR_FORM successful\n");
|
|
|
// }
|
|
|
// else {
|
|
|
// printf("Registering method CONNOR_REVISE_CLEAR_FORM failed %d\n", ifail);
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
//开旁路
|
|
|
{
|
|
|
numberOfArguments = 1;
|
|
|
functionPtr = Connor_open_bypass;
|
|
|
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
|
|
|
argumentList[0] = USERARG_STRING_TYPE;
|
|
|
returnValueType = USERARG_VOID_TYPE;
|
|
|
char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("CONNOR_open_bypass"));
|
|
|
tc_strcpy(mth_name, "CONNOR_open_bypass");
|
|
|
ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments,
|
|
|
argumentList, returnValueType));
|
|
|
MEM_free(argumentList);
|
|
|
if (status == ITK_ok)
|
|
|
{
|
|
|
printf("Method: %s\n", mth_name);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
printf("Method register failed [%d]: %s\n", status, mth_name);
|
|
|
}
|
|
|
}
|
|
|
{
|
|
|
ifail = METHOD_find_method("ItemRevision", TC_save_msg, &mth_tag);
|
|
|
if (mth_tag.id != 0) {
|
|
|
METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)ML_ItemRevSave, NULL);
|
|
|
printf("注册ItemRevision函数成功!\n");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
////文件夹后操作
|
|
|
//{
|
|
|
// ifail = METHOD_find_method("Folder", TC_save_msg, &mth_tag);
|
|
|
// if (mth_tag.id != 0) {
|
|
|
// METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)LD6_CusProdFolderSave, NULL);
|
|
|
// printf("注册LD6_CusProdFolderSave函数成功!\n");
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
|
|
|
//关旁路
|
|
|
{
|
|
|
numberOfArguments = 1;
|
|
|
functionPtr = Connor_close_bypass;
|
|
|
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
|
|
|
argumentList[0] = USERARG_STRING_TYPE;
|
|
|
returnValueType = USERARG_VOID_TYPE;
|
|
|
char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("CONNOR_close_bypass"));
|
|
|
tc_strcpy(mth_name, "CONNOR_close_bypass");
|
|
|
ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments,
|
|
|
argumentList, returnValueType));
|
|
|
MEM_free(argumentList);
|
|
|
if (status == ITK_ok)
|
|
|
{
|
|
|
printf("Method: %s\n", mth_name);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
printf("Method register failed [%d]: %s\n", status, mth_name);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//设置只读属性的值
|
|
|
{
|
|
|
numberOfArguments = 3;
|
|
|
functionPtr = connor_set_prop_value;
|
|
|
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
|
|
|
argumentList[0] = USERARG_STRING_TYPE;
|
|
|
argumentList[1] = USERARG_STRING_TYPE;
|
|
|
argumentList[2] = USERARG_TAG_TYPE;
|
|
|
returnValueType = USERARG_STRING_TYPE;
|
|
|
char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("Connor_Set_Prop_Value"));
|
|
|
tc_strcpy(mth_name, "Connor_Set_Prop_Value");
|
|
|
ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments,
|
|
|
argumentList, returnValueType));
|
|
|
MEM_free(argumentList);
|
|
|
if (status == ITK_ok)
|
|
|
{
|
|
|
printf("Method: %s\n", mth_name);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
printf("Method register failed [%d]: %s\n", status, mth_name);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
{
|
|
|
numberOfArguments = 3;
|
|
|
returnValueType = USERARG_STRING_TYPE;
|
|
|
functionPtr = uploadFile;
|
|
|
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
|
|
|
argumentList[0] = USERARG_STRING_TYPE;
|
|
|
argumentList[1] = USERARG_STRING_TYPE;
|
|
|
argumentList[2] = USERARG_STRING_TYPE;
|
|
|
status = USERSERVICE_register_method("uploadFile", functionPtr, numberOfArguments, argumentList, returnValueType);
|
|
|
if (status == ITK_ok)
|
|
|
{
|
|
|
printf("Registering uploadFile finished\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
printf("Registering uploadFile failed %d\n", status);
|
|
|
}
|
|
|
MEM_free(argumentList);
|
|
|
}
|
|
|
|
|
|
/*int
|
|
|
status = ITK_ok,
|
|
|
numberOfArguments = 0,
|
|
|
returnValueType = USERARG_STRING_TYPE,
|
|
|
*argumentList = NULL;
|
|
|
USER_function_t functionPtr;
|
|
|
|
|
|
|
|
|
METHOD_id_t mth_tag;
|
|
|
|
|
|
ITKCALL(ifail = METHOD_find_method ( "Schedule", TC_save_msg, &mth_tag ) );
|
|
|
if ( mth_tag.id != NULLTAG )
|
|
|
{
|
|
|
ITKCALL(ifail = METHOD_add_action( mth_tag, METHOD_post_action_type, (METHOD_function_t)Save_Schedule_Post_Action, NULL ) );
|
|
|
if(ifail==0) {
|
|
|
printf("Register method Save_Schedule_Post_Action success\n");
|
|
|
} else {
|
|
|
printf("Register method Save_Schedule_Post_Action failed %d\n", ifail);
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
return ITK_ok;
|
|
|
}
|
|
|
|
|
|
//extern DLLAPI int F_register_handlers(int *decision, va_list args)
|
|
|
// {
|
|
|
// int ifail = ITK_ok;
|
|
|
//
|
|
|
// //创建后操
|
|
|
// METHOD_id_t mth_tag;
|
|
|
// ifail = METHOD_find_method("Design Revision", ITEM_deep_copy_msg, &mth_tag);//参数1:类型,支持原生和客制化的;参数2:操作类型
|
|
|
// if (mth_tag.id != 0) {
|
|
|
// ifail = METHOD_add_action(mth_tag, METHOD_post_action_type, reviseDesignPost, NULL);//参数2:执行操作的时刻,支持前操作和后操作
|
|
|
// fprintf(stdout, "regist reviseDesignPost post_action successfully \n");
|
|
|
// }
|
|
|
// else {
|
|
|
// fprintf(stdout, "regist reviseDesignPost post_action failed \n");
|
|
|
// }
|
|
|
// return ifail;
|
|
|
// }
|