起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 226|回复: 9

【结贴】获取执行者人员名单**

[复制链接]
发表于 2008-6-19 11:53:13 | 显示全部楼层 |阅读模式
请问如图,如何获得执行者人员名单,我在做了一个通知规则,希望能够发完这个通知之后获取这个执行者名单保存到一个字段中,请问如何实现?

1.jpg

141.19 KB, 下载次数: 184

回复

使用道具 举报

发表于 2008-6-19 11:58:37 | 显示全部楼层
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-6-19 12:01:41 | 显示全部楼层
我不是说要代码指定执行者啊,我做的执行者可以在这个面板中选,不过点击确定以后要获得选定之后的这些人员名单!
回复 支持 反对

使用道具 举报

发表于 2008-6-19 12:29:10 | 显示全部楼层
在AfterFlowOut事件中,流转之后,会触发这个事件
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-6-19 14:18:49 | 显示全部楼层
我在afterflowout事件中写了如下代码来获取人员名称,执行到红色部分就报错:Access violation at address 024F1506 in module 'CLRModel.bpl'. Read of address 0000004C,是为什么,该怎么解决?
procedure THYJLZCT.FlowBroker1AfterFlowOut(Sender: TObject; Command: TFlowOutCommand);
var
  i:integer;
  lperson:Business.Model.Org.TPerson;
  s:string;
  lname:string;
  lsTemp:string;
begin
   lname:='';
   for i:=0 to Command.FlowTasks.FindFlowTask('FJ_1_HYJL').Executors.Count-1 do
   begin
        s:=Command.FlowTasks.FindFlowTask('FJ_1_HYJL').Executors.Items.PersonID;
        lPerson:= org.OrgSys.OrgSystem.GetPerson(s);
        lsTemp:= lPerson.DisplayName;
        if i=0 then lname:=lsTemp
        else lname:=lname+','+lsTemp;
   end;

          // l:= Command.FlowTasks.FindFlowTask('YWGN5').Executors.Items.
//end;
    DataSetBroker1.DataSet.edit;
    DataSetBroker1.DataSet.FieldByName('HYCJR').AsString := lname;
    DataSetBroker1.DataSet.Post;
    DataSetBroker1.DataSet.ApplyUpdates;
end;
回复 支持 反对

使用道具 举报

发表于 2008-6-19 15:42:22 | 显示全部楼层
lFlowTask : TFlowTask;
  ProcUnit : TProcUnit;
begin
   lname:='';
   ProcUnit := FlowBroker.FlowControl.CurrentProcUnit.SuccedentUnits[0];
lFlowTask := command.FlowTasks.GetFlowTask(ProcUnit);       //下一环节任务

lName := lFlowTask.Executors.Items.DeptID //变量i指第i个执行者
回复 支持 反对

使用道具 举报

发表于 2008-6-19 16:13:20 | 显示全部楼层
楼主在flowbroker的afternotify事件中添加如下代码试试:
procedure TYWLC1.ProcUnitRKAfterNotify(Sender: TObject; Command: TFlowNotifyCommand);
var i,j :integer;
begin
  for i:=0 to command.FlowTasks.Count-1 do
  begin
   for j:=0 to command.FlowTasks.Executors.count-1 do
   begin
     Dialogs.ShowMessage(command.FlowTasks.Executors[j].PersonID);
   end;
  end;
end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-6-19 16:25:32 | 显示全部楼层
谢谢,但是这里你给出的代码是人员ID,如何求得姓名呢,是需要到表里面去查,还是直接可以用代码转换呢?如果是代码的话,能否给出?
回复 支持 反对

使用道具 举报

发表于 2008-6-19 16:29:55 | 显示全部楼层
http://bbs.justep.com/forumdisplay.php?s=&forumid=26
请到 组织机构 中查看,有很多实例代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-6-19 16:41:17 | 显示全部楼层
好了 可以结贴了 谢谢
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-19 23:25 , Processed in 0.045931 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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