You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
62 lines
1.9 KiB
/*==============================================================================
|
|
Copyright (c) 2008-2018 Connor Corporation
|
|
Unpublished - All Rights Reserved
|
|
==============================================================================*/
|
|
#include "kutil.h"
|
|
|
|
int LD_ElevateTask(EPM_action_message_t msg)
|
|
{
|
|
printf("=========================提升流程节点 Start===================\n");
|
|
int ifail = ITK_ok, att_cnt = 0, i = 0, arg_cnt = 0;
|
|
tag_t task_tag = NULL_TAG, rootTask_tag = NULL_TAG;
|
|
task_tag = msg.task;
|
|
if (task_tag == NULLTAG)
|
|
{
|
|
return -1;
|
|
}
|
|
ITKCALL(EPM_ask_root_task(task_tag, &rootTask_tag));
|
|
char* taskname = NULL, * type = NULL;
|
|
ITKCALL(EPM_ask_name2(task_tag, &taskname));
|
|
ITKCALL(AOM_ask_value_string(task_tag, "object_type", &type));
|
|
printf("name=%s\n", taskname);
|
|
printf("type=%s\n", type);
|
|
if (strcmp(type, "EPMReviewTask") == 0 || strcmp(type, "EPMAcknowledgeTask") == 0)
|
|
{
|
|
int num = 0;
|
|
tag_t* sub_tags = NULL;
|
|
ITKCALL(EPM_ask_sub_tasks(task_tag, &num, &sub_tags));
|
|
for (int j = 0; j < num; j++)
|
|
{
|
|
char* taskname2 = NULL, * type2 = NULL;
|
|
ITKCALL(EPM_ask_name2(sub_tags[j], &taskname2));
|
|
ITKCALL(AOM_ask_value_string(sub_tags[j], "object_type", &type2));
|
|
if (strcmp(type2, "EPMPerformSignoffTask") == 0)
|
|
{
|
|
printf("name2=%s,type2=%s\n", taskname2, type2);
|
|
int valid_num = 0;
|
|
tag_t* valid_tags = NULL;
|
|
ITKCALL(AOM_ask_value_tags(sub_tags[j], "valid_signoffs", &valid_num, &valid_tags));
|
|
printf("valid_num=%d\n", valid_num);
|
|
if (valid_num == 0)
|
|
{
|
|
printf("未选人执行提升\n");
|
|
POM_AM__set_application_bypass(true);
|
|
ITKCALL(EPM_promote_task(task_tag, ""));
|
|
POM_AM__set_application_bypass(false);
|
|
}
|
|
DOFREE(valid_tags);
|
|
|
|
}
|
|
DOFREE(taskname2);
|
|
DOFREE(type2);
|
|
|
|
}
|
|
DOFREE(sub_tags);
|
|
|
|
}
|
|
DOFREE(taskname);
|
|
DOFREE(type);
|
|
printf("=========================提升流程节点 End===================\n");
|
|
return ITK_ok;
|
|
}
|