BeforeFlowOut事件上没有代码的
停在l流转窗体代码中,红色部分报的错
procedure TFLOWOUTFORM.RefreshFlowTaskNodes;
var
I: Integer;
lFlowTask: TFlowTask;
lNode: TFlowTaskNode;
FlowGUID,FlowID,FlowName:string;
ProjectID:string;
pQuery:TQuery;
begin
for I := 0 to FlowTaskGraph.NodeCount - 1 do
begin
lNode := TFlowTaskNode(FlowTaskGraph.Nodes[I]);
if lNode.ProcUnit.Kind in Flow.SProcActivityKinds then
begin
lFlowTask := FlowTasks.FindFlowTask(lNode.ProcUnit, True);
lNode.Selected := (lFlowTask <> nil) and (lFlowTask.Executors.Count > 0);
if lNode.CanSelect then
begin
FlowGUID:=lFlowTask.Flow.GUID;
FlowID:=lNode.ProcUnit.ID;
FlowName:=lNode.ProcUnit.DisplayName;
pQuery:=TQuery.Create(self);
pQuery.ConnectionString:='DATABASEURL=Biz:\SYSTEM\SYSTEM.DATABASE';
pQuery.CommandText:='select fID from tflow where fguid='''+FlowGUID +'''';
pQuery.Open;
if pQuery.Eof=false then
begin
ProjectID:=StrUtils.AnsiReplaceStr(StrUtils.AnsiReplaceStr(TBlobField(pQuery.FieldByName('fID')).AsString,#13,''),#10,'');
end;
pQuery.Free;
pQuery:=TQuery.Create(self);
pQuery.ConnectionString:='DATABASEURL=Biz:\COLLABORATION\COLLABORATION.DATABASE';
pQuery.CommandText:='select fplanfinishtime from tplan where fparentplanid in (select fplanid from tplan where fplancode ='''+ ProjectID +''' and fplanstate<>''psPlanDeleted'')and fplancode ='''+ FlowID +''' and fplanstate<>''psPlanDeleted''';
pQuery.Open;
if pQuery.Eof=false then
begin
lFlowTask.LimitTime:=pQuery.FieldByName('fplanfinishtime').AsDateTime;
//lFlowTask.LimitTime:=SysUtils.StrToDateTime('2008-02-28 16:00:00');
end;
pQuery.Free;
end;
end
else
lNode.Selected := False;
end;
end; |