RoleMapping theMapping = humanActivity.getRole().getMapping(instance);
if(theMapping !=null){
theMapping.beforeFirst();
do{
TransactionContext tc;
if(DW_DSN!=null){
tc = new SimpleTransactionContext(DW_DSN);
}else{
tc = instance.getProcessTransactionContext();
}
ResourceDimensionDAOType resourceDimensionDAOType = ResourceDimensionDAOType.getInstance(tc);
if(resourceDimensionDAOType.existAnyResourceWhereRsrc_Id(theMapping.getEndpoint())) continue;
if(theMapping.getGroupName()==null)
theMapping.fill(instance);
ResourceDimensionDAO resourceDimension = resourceDimensionDAOType.createDAOForInsert();{
resourceDimension.setRsrc_Id(theMapping.getEndpoint());
resourceDimension.setRsrc_Name(theMapping.getResourceName());
resourceDimension.setGender(theMapping.isMale());
resourceDimension.setDept_Name(theMapping.getGroupName());
resourceDimension.setDept_Id(theMapping.getGroupId());
if(theMapping.getBirthday()!=null)
resourceDimension.setBirthDay(new Long(1900 + theMapping.getBirthday().getYear()));
}
resourceDimension.insert();
if(tc instanceof SimpleTransactionContext)
tc.releaseResources();
}while(theMapping.next());
theMapping.beforeFirst();
}