基本管理 > 支援協同合作 > 工作流程管理 > 工作流程工具 > 工作流程範本管理 > 工作流程程式碼範例 > 路由範本 > 文件類型的分支
  
文件類型的分支
本主題提供以文件類型為基準的企業物件路由範例。
參考的工作流程
BranchOnDocumentType.xml
描述
以下的運算式會檢查文件的類型,並分成以下四種路由事件之一文件通常可以為需求、規格、文件或 TestPlan。此前提是 primaryBusinessObject 是由生命週期所管理的。
指示
將 <路由事件> 標籤取代為您想為工作流程範本定義的路由事件,並指定您想從該位置進行分支的文件類型。
有關文件類型的詳細資訊,請參閱 wt.doc.DocumentTypeRB.java。
請從下一行開始複製以下程式碼:
//retrieve document type of the PBO wt.doc.DocumentType docType = ((( wt.doc.WTDocument )primaryBusinessObject). getDocType( ));
//check for document type of PBO . Note how the type is given as "$$Specification". This is how the type is stored in the //database.
if ( docType==wt.doc.DocumentType.toDocumentType( "$$Specification") )
result= "<routing event>";
else if ( docType==wt.doc.DocumentType.toDocumentType( "$$Requirements") )
result= "<routing event>";
else if ( docType==wt.doc.DocumentType.toDocumentType( "$$Document") )
result= "<routing event>"; else result= "<routing event>";