当前位置: 首页 > news >正文

流程提交和退回的handler - 张永全

 



int v9_demote_to_node(EPM_action_message_t msg) {
int rcode = ITK_ok;
tag_t task = msg.task;
tag_t job_tag = NULLTAG;
tag_t root_task = NULLTAG;
tag_t crtTarget = NULLTAG;
int targetNum = 0;
tag_t* targets = NULL;

int argNumber = 0;

int i = 0;
char status[WSO_name_size_c + 1] = { '\0' };

 

//获取流程目标
ITKCALL(EPM_ask_job(msg.task, &job_tag));
ITKCALL(EPM_ask_root_task(job_tag, &root_task));
ITKCALL(EPM_ask_attachments(root_task, EPM_target_attachment, &targetNum, &targets));

 

//ITKCALL(EPM_trigger_action(msg.task, EPM_demote_action, "自动退回"));
//rcode = EPM_trigger_action(msg.task, EPM_approve_action, "Some comment");
//char* action = "SOA EPM demote action";
//char* comment = "根据属性条件返回到指定节点";
// ==============================================
// 如果当前动作是【驳回/拒绝】
// ==============================================

if (msg.action == EPM_reject_action) {

tag_t current_task = NULLTAG;
char* current_task_type = NULL;
ITKCALL(AOM_ask_value_string(msg.task, "object_type", &current_task_type));
if (strcmp(current_task_type, "EPMPerformSignoffTask") == 0) {
ITKCALL(AOM_ask_value_tag(msg.task, "parent_task", &current_task));
}
else {
current_task = msg.task;
}
//EPM_demote_task(current_task, "DO");

if (current_task) {
logical has_previous_task = true;
while (current_task) {
char* object_name = NULL;
tag_t previous_task = NULLTAG;
ITKCALL(AOM_ask_value_string(current_task, "object_name", &object_name));
ITKCALL(AOM_ask_value_tag(current_task, "previous_task", &previous_task));//predecessors
if (strcmp(object_name, "校对") == 0 && previous_task) {
has_previous_task = false;
}
else {
setOpenByPass();
rcode = EPM_demote_task(current_task, "DO");
char* err_string = NULL;
EMH_ask_error_text(rcode, &err_string);
printf("\nERROR: %d ERROR MSG: %s.\n", rcode, err_string);
SAFE_SM_FREE(err_string);
setCloseByPass();
ITKCALL(AOM_ask_value_tag(current_task, "previous_task", &current_task));
current_task = previous_task;
}
SAFE_SM_FREE(object_name);
}
}
SAFE_SM_FREE(current_task_type);
}
else if (msg.action == EPM_start_action) {
/*放到开始事件上,如果当前节点不是要提升的目的节点,则提升当前节点,*/
char* status = NULL;
ITKCALL(AOM_ask_value_string(msg.task, "object_desc", &status));
if (strcmp(status,"")) {

}
setOpenByPass();
AOM_lock(root_task);
AOM_set_value_string(root_task, "object_desc", "Running");
AOM_save(root_task);
AOM_unlock(root_task);
setCloseByPass();
tag_t current_task = NULLTAG;
char* current_task_type = NULL;
ITKCALL(AOM_ask_value_string(msg.task, "object_type", &current_task_type));
if (strcmp(current_task_type, "EPMPerformSignoffTask") == 0) {
ITKCALL(AOM_ask_value_tag(msg.task, "parent_task", &current_task));
}
else {
current_task = msg.task;
}
char* object_name = NULL;
ITKCALL(AOM_ask_value_string(current_task, "object_name", &object_name));
if (strcmp(object_name, "Approve") != 0) {
setOpenByPass();
EPM_promote_task(current_task, "Approve");
setCloseByPass();
setOpenByPass();
AOM_lock(root_task);
AOM_set_value_string(root_task, "object_desc", "Finish");
AOM_save(root_task);
AOM_unlock(root_task);
}
SAFE_SM_FREE(object_name);
/*//EPM_demote_task(current_task, "DO");
ITKCALL(AOM_ask_value_string(current_task, "object_type", &current_task_type));
if (current_task) {
setOpenByPass();
EPM_promote_task(current_task, "Approve");
setCloseByPass();
logical has_next_task = true;
while (has_next_task && current_task) {
char* object_name = NULL;
ITKCALL(AOM_ask_value_string(current_task, "object_name", &object_name));
if (strcmp(object_name, "Approve")==0) {
has_next_task = false;
}
else {
tag_t* successors = NULL;
int n_successors = 0;
ITKCALL(AOM_ask_value_tags(current_task, "successors",&n_successors,&successors));
if (n_successors > 0) {
for (i = 0; i < n_successors; i++)
setOpenByPass();
ITKCALL(AOM_ask_value_string(successors[i], "object_name", &object_name));
ITKCALL(AOM_ask_value_string(successors[i], "object_type", &current_task_type));

EPM_promote_task(successors[i], "Approve");
setCloseByPass();
current_task = successors[i];
}
else {
has_next_task = false;
}
SAFE_SM_FREE(successors);
}
SAFE_SM_FREE(object_name);
}
}
SAFE_SM_FREE(current_task_type);*/
setCloseByPass();
}
EMH_clear_errors();


return rcode;
}

#ifdef __cplusplus
}
#endif

http://www.jsqmd.com/news/617894/

相关文章:

  • CentOS7.6环境下离线升级GCC至8.3.0的完整指南
  • CPPM考试全攻略:考试科目、题型分值及备考重点梳理 - 众智商学院官方
  • 新手也能看懂的Wireshark实战:从一道CTF题手把手教你分析FTP和HTTP攻击流量
  • FanControl终极指南:从零配置到高级调优的Windows风扇控制方案
  • Windows任务栏定制终极指南:7+ Taskbar Tweaker完全掌控你的桌面体验
  • Verdi信号处理实战:如何用Excel快速计算特定条件下的信号均值(附详细步骤)
  • 我不是狐狸,我是那Harness Engineering脖
  • Python之Flask开发框架开发项目阿里云部署介绍
  • 在openEuler 22.03上离线部署Nginx 1.28.0,我踩过的坑和总结的完整流程
  • 终极微信读书笔记同步指南:Obsidian Weread插件完整教程
  • 哑铃型制样机优质供应商评选:专业生产商的综合实力探析 - 品牌推荐大师1
  • 她拿过枪,打过丧尸,现在用一座“记忆宫殿”拿下了AI记忆系统的世界第一
  • 【图灵完备(Turing Complete)】四、处理器架构2:从逻辑门到LEG指令集
  • 射频链的构成
  • 极致窗口收纳神器:Traymond让Windows任务栏瞬间清爽
  • 如何用Traymond将Windows窗口轻松收纳到系统托盘?
  • Akebi-GC终极指南:三步解锁原神高效游戏体验,告别重复劳动烦恼
  • 从水桶比喻到数学公式:深入理解施密特触发器RC振荡电路中的电容充放电
  • 太阳能电池缺陷检测数据集:2624张EL图像标准化基准
  • Day17——类与对象
  • TMSpeech:Windows上完全离线的实时语音转文字终极指南
  • Cursor Pro破解终极指南:3步实现AI编程神器永久免费使用
  • Speechless:你的微博记忆守护者 - 3步完成永久备份的终极指南
  • 如何用10分钟语音数据突破AI语音转换的极限?Retrieval-based-Voice-Conversion-WebUI实战深度解析
  • Dify 1.11.0升级后,我的企业知识库终于能看懂PPT截图了:多模态RAG实战踩坑记录
  • AI股票分析师案例分享:快速生成包含风险与展望的简明报告
  • 售后服务定胜负!大地网测试仪企业服务能力深度对比与推荐 - 品牌推荐大师
  • 8个主流漫画网站批量下载工具:comics-downloader实战指南
  • Outlook 2010 邮箱告急?三步高效清理与压缩实战指南
  • 拥抱家庭维修新选择:一号房医家庭维修如何用专业与透明守护千家万户 - 品牌评测官