天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 1624|回复: 7

[已解决] 终止流程时未能获得flowType值

[复制链接]
北京智源普华 发表于 2014-5-30 13:14:14 | 显示全部楼层 |阅读模式
本帖最后由 Jarod 于 2014-6-11 18:20 编辑

var process=getDocProcess(getApplication());
var doc=getCurrentDocument();
var flowType = getParameter("_flowType");
println("flowType:"+flowType);


if (flowType!=null && flowType.equals("81")) {
          doc.findItem("审批状态").setValue("驳回");
          process.doUpdate(doc);
}//回退
else if (flowType!=null && flowType.equals("7")) {
            doc.findItem("审批状态").setValue("已批准");
            process.doUpdate(doc);
}else if (flowType!=null && flowType.equals("8")) {
            doc.findItem("审批状态").setValue("已终止");
            process.doUpdate(doc);
}else{
            //审批中
            doc.findItem("审批状态").setValue("审批中");
            process.doUpdate(doc);
}

上述代码用于根据flowType更改业务表审批状栏位,但终止流程时,这招就不能用了呢,还提示表构建失败之类,其他流程操作均没问题。

附:
windows7旗舰版+oracle 11g +M3 obpm 19992 + chrome
 楼主| 北京智源普华 发表于 2014-5-30 15:38:41 | 显示全部楼层
终止流程时候,如何获得获得当前动作的flowType,从而改变业务表的审核状态栏位值?????
punk 发表于 2014-6-6 10:38:59 | 显示全部楼层
您好~换成用这个方法获取值
var doc=getCurrentDocument();
var flowType =doc.getLastFlowOperation();
有问题再沟通~
 楼主| 北京智源普华 发表于 2014-6-7 12:38:33 | 显示全部楼层
本帖最后由 北京智源普华 于 2014-6-7 15:59 编辑

经测试,故障依旧!!!

经在chrome和IE下测试发现,点击【终止流程】按钮,会提示“是否终止流程?终止后不可恢复”之类的提示,点击【确定】,报错信息见下图:
无标题.png

接着点击【确定】又提示,终止流程成功,后面数据表LastFlowOperation字段已经变为8,其实就是终止状态,但为何flowType就是取不值呢?为何提示表单构建失败呢?



附变更后代码:
var process=getDocProcess(getApplication());
var doc=getCurrentDocument();
//var flowType = getParameter("_flowType");
var flowType =doc.getLastFlowOperation();
var statelabel = getStateLabel();
if (flowType !=null){
        println("flowType:"+flowType);
}
if (flowType!=null && flowType.equals("81")) {
          doc.findItem("审批状态").setValue("驳回");
          process.doUpdate(doc);
}//回退
else if (flowType!=null && flowType.equals("7")) {
            doc.findItem("审批状态").setValue("已批准");
            process.doUpdate(doc);
}else if ((statelabel != null && statelabel.equals('终止')) || (flowType!=null && flowType.equals("8"))) {
            doc.findItem("审批状态").setValue("已终止");
            process.doUpdate(doc);
}else{
        if (flowType !=null){
            //审批中
            doc.findItem("审批状态").setValue("审批中");
            process.doUpdate(doc);
        }
}
Jarod 发表于 2014-6-9 19:03:28 | 显示全部楼层
从doc中通过getFlowtype方法获取,不要从parameter中获取
 楼主| 北京智源普华 发表于 2014-6-9 23:39:17 | 显示全部楼层
经测试,故障依旧!!!
//var flowType = getParameter("_flowType");
//var flowType =doc.getLastFlowOperation();
var flowType =doc.getFlowType();
三种方式都试过了,终止流程就是不行!!!
punk 发表于 2014-6-10 09:35:12 | 显示全部楼层
联系我,远程看看~
punk 发表于 2014-6-11 17:24:24 | 显示全部楼层
通过联系客户,用于该项目已上线,客户去掉了终止流程这个功能,故已不存在这个问题,我建议客户可以把脚本放在终止的流程线上执行更改。客户表示明白以后会尝试这么做。故该贴结贴~有问题的话可以再跟回帖。

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-13 16:20

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表