if (transaction != null) {
IdentitySessionResource identitySessionResource = new IdentitySessionResource(identitySession);
transaction.enlistResource(identitySessionResource);
}
return new JBossIdmIdentitySessionImpl(identitySession);
} catch (IdentityException e) {
throw new JbpmException("couldn't create the identity session for realm [" + realmName + "]");
}
}