getProcessDefinition().firePropertyChangeEventToActivityFilters(this, "roleMapping", roleMapping);
return;
}
RoleMappingDAOType rmDAOType = RoleMappingDAOType.getInstance(ptc);
int count = 0;
if(!isBatch){
rmDAOType.removeRoleMapping(getInstanceId(), roleName);
roleMappingDAO = rmDAOType.createDAOForInsertRoleMappingBatch();
}
if(roleMapping==null){
return; //to clear the rolemapping, simply skip inserting to database
}
roleMapping.beforeFirst();
do{
RoleMapping currMapping = roleMapping.getCurrentRoleMapping();
if(currMapping==null)
continue;
currMapping.makeSingle();
if(roleMapping.getCurrentRoleMapping().resourceName == null){
roleMapping.fill(this);
}
boolean verifyOK = true;
switch ( currMapping.getAssignType() ) {
case Role.ASSIGNTYPE_USER:
if(currMapping.getEndpoint() == null ){
if(currMapping.size()-1 != currMapping.getCursor())
throw new UEngineException("One of rolemapping value has null endpoint.");
verifyOK = false;
}
break;
}
if(verifyOK){
rmDAOType.insertRoleMappingBatch(roleMappingDAO, new Long(getInstanceId()), new Long(getRootProcessInstanceId()), roleName, currMapping);
count++;
}
}while(roleMapping.next());
roleMapping.beforeFirst();