Identity newIden = new Identity();
// Setting the identity's attributes in the object
newIden.setName(identityName);
newIden.setFirstname(firstname);
newIden.setLastname(lastname);
newIden.setAttribute("employment_type_cd",type);
newIden.setEmail(email);
newIden.setAttribute("company_name",companyName);
newIden.setAttribute("emp_b_cell_no",mobile.replaceAll(" ",""));
newIden.setAttribute("country",country.toUpperCase());
newIden.setAttribute("emp_start_work_date",startWorkDate);
newIden.setAttribute("emp_stop_work_date",stopWorkDate);
// Getting the new identity's Manager
Identity idenManager = context.getObjectByName(Identity.class,manager);//"emp_identity_id"
// Checking whether the manager is exists and in case that it is set it as the identity's manager
if (idenManager != null)
{
newIden.setManager(idenManager);
}
// Save the identity
context.saveObject(newIden);
// Create the identity on IIQ
context.commitTransaction();