기본 관리 > 공동 작업 지원 > 워크플로 관리 > 워크플로 도구 > 워크플로 템플릿 관리 > 워크플로 코드 예 > 라우팅 예 > 문서 유형의 분기
  
문서 유형의 분기
이 항목에서는 문서 유형을 기반으로 비즈니스 객체 라우팅의 예제를 제공합니다.
참조된 워크플로
BranchOnDocumentType.xml
설명
아래 표현식은 문서의 유형을 확인하고 네 개의 라우팅 이벤트 중 하나로 분기합니다. 일반적으로 문서는 요구사항, 사양, 문서 또는 TestPlan일 수 있습니다. primaryBusinessObject는 관리된 라이프 사이클로 간주됩니다.
지침
<routing event> 태그를 워크플로 템플릿에 대해 정의할 라우팅 이벤트로 바꾸고 분기할 문서 유형을 지정합니다.
문서 유형에 대한 자세한 내용은 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>";