起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 756|回复: 28

【结贴】真不知道啥是对的了,哎!**

[复制链接]
发表于 2008-7-29 11:18:30 | 显示全部楼层 |阅读模式
procedure TDBJMAIN.FlowBroker1CreateFlowOutFlowTasks(Sender: TObject; Command: TFlowOutCommand);
var
  lFlowTask:TFlowTask;
  nNum :integer;
  i:integer;
  sUserId:string;
  sDeptId:string;
  oDataSet:TSQLDataSet;
begin
//
if(DataSetBroker1.DataSet.RecNo > 0)then
begin
    sUserId := DataSetBroker1.DataSet.FieldByName('SBR').asString;
    sDeptId := DataSetBroker1.DataSet.FieldByName('SBRBM').asString;
end;

if(sUserId.Length > 0) and (sDeptId.Length > 0)then
begin
   lFlowTask := Command.FlowTasks.FindFlowTask('SBJ');   //下一个流程环节的ID
   if(lFlowTask <> nil)then
   begin
      lFlowTask.Executors.Clear();

      lFlowTask.Executors.Add(TOrgURL.Create(sDeptId,'',sUserId));

      lFlowTask.ReLoadAllowExecutors;
      lFlowTask.ReLoadExecutors;
   end;
end;

end;
这代码没有问题吧,为何流程还是发给了两个人
回复

使用道具 举报

 楼主| 发表于 2008-7-29 11:26:42 | 显示全部楼层
人呢
回复 支持 反对

使用道具 举报

发表于 2008-7-29 11:29:19 | 显示全部楼层
TOrgURL.Create(sDeptId,'',sUserId)  能查到执行者吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-29 11:30:15 | 显示全部楼层
啥叫能查到吗? 该用户是下一个功能环节中的一个。
数值测试通过,都有值
回复 支持 反对

使用道具 举报

发表于 2008-7-29 11:34:13 | 显示全部楼层
lFlowTask.Executors.Add(TOrgURL.Create(sDeptId,'',sUserId));
lFlowTask.Executors.Add是加入执行者,    TOrgURL.Create(sDeptId,'',sUserId)能得到执行者的URL吗?   调试一下,它的返回值, 是一个执行者,还是多个,还是空?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-29 11:37:28 | 显示全部楼层
有值
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-29 11:41:06 | 显示全部楼层
流程上有没有其他设置呀?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-29 11:46:26 | 显示全部楼层
nRes := lFlowTask.Executors.Count;
      nRes := nRes;   // 等于 2

      lFlowTask.Executors.Clear();

      oRes := TOrgURL.Create(sDeptId,'',sUserId);
      lFlowTask.Executors.Add(oRes);

      lFlowTask.ReLoadAllowExecutors;
      lFlowTask.ReLoadExecutors;

      nRes := lFlowTask.Executors.Count;
      nRes := nRes;  // 等于 2

这代码不起作用呀,清除了后添加应该 nRes = 1呀
  lFlowTask.Executors.Clear();
      oRes := TOrgURL.Create(sDeptId,'',sUserId);
      lFlowTask.Executors.Add(oRes);
回复 支持 反对

使用道具 举报

发表于 2008-7-29 11:46:43 | 显示全部楼层
在lFlowTask.Executors.Add后面 遍历一下,看加入了几个URL
lFlowTask.Executors.Count
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-29 11:55:01 | 显示全部楼层
8楼的消息,你没有注意到吗?
我在最后测试了COUNT 还是没有变
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-21 03:23 , Processed in 0.043705 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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