Teamcenter 动态创建和执行action-handler
GAOM_set_bypass(true);
tag_t action_handler = NULLTAG;
EPM_action_t action = EPM_undo_action;
const char* name = "EPM-demote";
string target_task_str = "-target_task=";
target_task_str.append(v9_demote_to_node);
const char* args[1] = { target_task_str.c_str() };
tag_t task_template = NULLTAG;
ITKCALL(AOM_ask_value_tag(current_task, "task_template", &task_template));
ITKCALL(EPM_create_action_handler2(task_template, action, name, 1, args, &action_handler));
ITKCALL(EPM_trigger_action(current_task, action, "AutoDemote"));
ITKCALL(EPM_remove_action_handler(task_template, action, action_handler, TRUE));
AOM_lock(root_task);
AOM_set_value_string(root_task, "v9_demote_status", "Promoting");
AOM_save_with_extensions(root_task);
AOM_unlock(root_task);
GAOM_set_bypass(false);
浙公网安备 33010602011771号