|

楼主 |
发表于 2008-2-29 11:10:15
|
显示全部楼层
最初由 jiahaiminghr 发布
[B]
在流程结束时发通知: 怎么发的?
通知会出现在任务跟踪里: 任务跟踪在哪里?
在studio中调试运行时..
以下省略...... [/B]
1.流程结束前的环节,详细见图
2.略
3.unit TASKSUMMARY;
interface
uses
Business.System, Business.Model, Business.Forms, Business.Data,
Borland.Delphi.Windows, SystemCore, TaskLib, RelevancyLib, TaskDefineInfo,
CM, SystemUtils;
type
{ TTaskFuncRunner }
TFuncInitProc = procedure(AFunc: TFunc; ATask: TTask) of object;
TTaskFuncRunner = class(TComponent)
private
FInfoBroker: TInfoBroker;
FFuncBroker: TFuncBroker;
FDocView: TDocView;
FDocFileName: string;
FActive: Boolean;
FBizDataSetAction: TBizDataSetAction;
function GetFunc: TFunc;
function GetInfo: TInfo;
function GetDoc: TDoc;
procedure SetActive(Value: Boolean);
function GetFuncContext(const AFuncURL: string): Business.Model.TContext;
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
constructor Create(AOwner: TComponent; const AFuncURL, ADocURL: string;
AParent: TWinControl; AFuncInitProc: TFuncInitProc; ATask: TTask);
destructor Destroy; override;
procedure Save;
function SaveNeeded: Boolean;
procedure Delete;
function CanDelete: Boolean;
procedure Cancel;
procedure Refresh;
property Func: TFunc read GetFunc;
property Info: TInfo read GetInfo;
property DocView: TDocView read FDocView;
property Doc: TDoc read GetDoc;
property Active: Boolean read FActive write SetActive;
end;
{ TTaskSummary }
TTASKSUMMARY = class(TFormDoc)
pnlClient: TPanel;
procedure FormDocCreate(Sender: TObject);
procedure FormDocDestroy(Sender: TObject);
private
FUseCache: Boolean;
FTaskChangeNotifyDelegate: TTaskNotifyDelegate;
FTask: TTask;
FCurrentFuncRunner: TTaskFuncRunner;
FTaskNeedReload: Boolean;
FFuncs: TStringList;
FFuncsUseCount: array of Integer;
// ±¾µØ¼Çס±äÁ¿£¬ÐèÒªÌṩ¸üºÃµÄ»ú»á
FRelevancyNavBar: TRelevancyNavBar;
procedure SetRelevancyNavBar(Value: TRelevancyNavBar);
procedure SetTask(Value: TTask);
procedure TaskChangeNotify(const TaskGUIDs: array of string);
procedure SwitchDocView(AOldDocView, ANewDocView: TDocView);
procedure RefreshDataSets(ADoc: TDoc; OnlyRefresh: Boolean);
procedure InitFunc(AFunc: TFunc; ATask: TTask);
function RunFunc(const AFuncURL, ADocURL: string; ATask: TTask; AReadOnly: Boolean): TFunc;
procedure ClearFuncs;
procedure ClearRunFunc;
procedure SmartDestroyFuncRunner;
function DocViewFocused(ADocView: TDocView): Boolean;
procedure RealRefreshRelevancyBar;
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
property RelevancyNavBar: TRelevancyNavBar read FRelevancyNavBar write SetRelevancyNavBar;
public
procedure SetFocus; override;
procedure GetUsingDataSetList(AList: TBizDataSetList); override;
procedure RefreshRelevancyBar(ARelevancyNavBar: TRelevancyNavBar);
function CanView(ATask: TTask): Boolean;
procedure Reload;
procedure Save;
function SaveNeeded: Boolean;
procedure Delete;
function CanDelete: Boolean;
procedure Cancel;
procedure Refresh;
property UseCache: Boolean read FUseCache write FUseCache;
property Task: TTask read FTask write SetTask;
property CurrentFuncRunner: TTaskFuncRunner read FCurrentFuncRunner;
end;
implementation
const
cDefaultDoc = 'Biz:\COLLABORATION\TaskCenterInfo.Info\DefaultDetailView.SheetDoc';
cMaxFuncCount = 10;
type
TDetailDocView = Class(TDocView)
protected
procedure Paint; override;
end;
procedure TDetailDocView.Paint;
const
cNoDocDesc = 'ÎÞÏêϸÐÅÏ¢';
var
lRect: TRect;
lFontHeight: Integer;
lFlags: Longint;
begin
if DocFileName = '' then
begin
lRect := ClientRect;
Canvas.Brush.Color := Color;
Canvas.FillRect(lRect);
Canvas.Brush.Style := TBrushStyle.bsClear;
Canvas.Font := Font;
lFontHeight := Canvas.TextHeight('W');
with lRect do
begin
Top := ((Bottom + Top) - lFontHeight) div 2;
Bottom := Top + lFontHeight;
end;
lFlags := DT_EXPANDTABS or DT_VCENTER or DT_CENTER;
lFlags := DrawTextBiDiModeFlags(lFlags);
DrawText(Canvas.Handle, PChar(cNoDocDesc), -1, lRect, lFlags);
end
else
inherited;
end;
{ TTaskFuncRunner }
constructor TTaskFuncRunner.Create(AOwner: TComponent; const AFuncURL, ADocURL: string;
AParent: TWinControl; AFuncInitProc: TFuncInitProc; ATask: TTask);
var
lBizClassRef: TBizClassRef;
begin
inherited Create(AOwner);
FFuncBroker := TFuncBroker.Create(Self);
FFuncBroker.AutoKind := TAutoKind.akPrivate;
FFuncBroker.AutoBroker := False;
lBizClassRef := TBizClassRef.Create(nil);
try
lBizClassRef.BizURL.URL := AFuncURL;
// ¶ÔÓ¦¹¦Äܲ»´æÔÚʱ£¬´´½¨Ò»¸ö¿Õ¹¦ÄÜ
if FFuncBroker.BizClassRef.BizURL.URL = '' then
FFuncBroker.Func := TFunc.Create(GetFuncContext(AFuncURL))
else
FFuncBroker.Func := BizSys.BizService.CreateBizObject(lBizClassRef, GetFuncContext(AFuncURL)) as TFunc;
finally
lBizClassRef.Free;
end;
if Assigned(AFuncInitProc) then
AFuncInitProc(FFuncBroker.Func, ATask);
FInfoBroker := TInfoBroker.Create(Self);
FInfoBroker.FuncBroker := FFuncBroker;
FInfoBroker.BizClassRef.BizURL.URL := SysUtils.ExtractFileDir(ADocURL);//跟到这里出错
FDocView := TDetailDocView.Create(Self);
FDocView.InfoBroker := FInfoBroker;
FDocView.Visible := False;
FDocView.Align := TAlign.alClient;
FDocView.Parent := AParent;
FDocFileName := SysUtils.ExtractFileName(ADocURL);
FBizDataSetAction := TBizDataSetAction.Create(Self);
FBizDataSetAction.ID := BizActnConsts.ActionDataSetDelete;
FBizDataSetAction.AutoDetect := True;
end;
.................................................
请问怎样做才能让“通知”不在“我的任务(任务跟踪)”里列出来 |
|