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.

77 lines
1.9 KiB

#include"kutil.h"
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include "libxl.h"
#include <io.h>
#include <direct.h>
#include <cfm/cfm.h>
#include <wchar.h>
#include <locale>
#include <codecvt>
#include <chrono>
#include <Windows.h>
#include <thread>
#include <regex>
#include <res\reservation.h>
#include "libxl.h"
#include <map>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <filesystem>
using namespace libxl;
using namespace std::chrono_literals;
using namespace std;
#define debug true
#define ITK_err 919012
int UpgradeTask(EPM_action_message_t msg) {
printf("++++++++++++++++++开始提升流程节点++++++++++++++++++++\n");
POM_AM__set_application_bypass(true);
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* uid;
ITK__convert_tag_to_uid(rootTask_tag, &uid);
printf("uid:%s\n", uid);
int allstartnum = 0; tag_t* allstart;
ITKCALL(AOM_ask_value_tags(rootTask_tag, "child_tasks", &allstartnum, &allstart));
for (int i = 0; i < allstartnum;i++) {
char* taskName;
ITKCALL(AOM_ask_value_string(allstart[i], "object_name", &taskName));
printf("子任务%d:%s\n",i,taskName);
}
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, "EPMDoTask") == 0)
{
EPM_remove_task_hold(task_tag);
printf("开始提升节点\n");
ITKCALL(EPM_promote_task(task_tag, ""));
printf("提升节点结束\n");
}
DOFREE(taskname);
DOFREE(type);
POM_AM__set_application_bypass(false);
printf("++++++++++++++++++提升流程节点结束++++++++++++++++++++\n");
return ITK_ok;
}