아래의 코드 스니펫은 PDCCaseOwnerAssignmentStrategy에 대한 샘플 구현을 보여줍니다. 이 스니펫은 단순히 소유자를 시스템 사용자가 되도록 설정합니다.
@Singleton
public class SampleCaseOwnerAssignmentStrategyImpl
implements PDCCaseOwnerAssignmentStrategy {
public void createOwner(CaseHeaderKey key, OrgObjectLinkDtls ownerDtls)
throws AppException, InformationalException {
ownerDtls.orgObjectType = ORGOBJECTTYPE.USER;
ownerDtls.userName = UserAccessFactory.newInstance().getSystemUserDetails().userName;
OrgObjectLinkFactory.newInstance().insert(ownerDtls);
OrgObjectLinkKey orgObjectLinkKey = new OrgObjectLinkKey();
orgObjectLinkKey.orgObjectLinkID = ownerDtls.orgObjectLinkID;
CaseUserRoleDtls caseUserRoleDtls = new CaseUserRoleDtls();
caseUserRoleDtls.caseID = key.caseID;
caseUserRoleDtls.orgObjectLinkID = orgObjectLinkKey.orgObjectLinkID;
caseUserRoleDtls.typeCode = CASEUSERROLETYPE.OWNER;
caseUserRoleDtls.recordStatus = RECORDSTATUS.NORMAL;
curam.core.sl.entity.fact.CaseUserRoleFactory.newInstance().insert(caseUserRoleDtls);
CaseHeader caseHeaderObj = CaseHeaderFactory.newInstance();
CaseHeaderDtls caseHeaderDtls = caseHeaderObj.read(key);
caseHeaderDtls.ownerOrgObjectLinkID = orgObjectLinkKey.orgObjectLinkID;
caseHeaderObj.modify(key, caseHeaderDtls);
}
}