use of org.estatio.module.party.fixtures.person.builders.PersonPartyRolesBuilder in project estatio by estatio.
the class PersonAndRolesBuilder method execute.
@Override
public void execute(ExecutionContext executionContext) {
object = new PersonBuilder().setReference(reference).setFirstName(firstName).setInitials(initials).setLastName(lastName).setAtPath(atPath).setPersonGenderType(personGenderType).build(this, executionContext).getObject();
if (securityUsername != null) {
applicationUser = new ApplicationUserBuilder().setPerson(object).setSecurityUsername(securityUsername).setSecurityUserAccountCloneFrom(securityUserAccountCloneFrom).build(this, executionContext).getObject();
}
if (emailAddress != null || phoneNumber != null) {
new PersonCommsBuilder().setPerson(object).setEmailAddress(emailAddress).setPhoneNumber(phoneNumber).build(this, executionContext);
}
if (relationshipType != null && fromParty != null) {
partyRelationship = new PersonRelationshipBuilder().setPerson(object).setRelationshipType(relationshipType.fromTitle()).setFromParty(fromParty).build(this, executionContext).getObject();
}
partyRoles = new PersonPartyRolesBuilder().setPerson(object).addPartyRoleTypes(partyRoleTypes).build(this, executionContext).getObject();
fixedAssetRoles = new PersonFixedAssetRolesBuilder().setPerson(object).setFixedAssetRoleSpecs(fixedAssetRoleSpecs).build(this, executionContext).getObject();
}
use of org.estatio.module.party.fixtures.person.builders.PersonPartyRolesBuilder in project estatio by estatio.
the class PersonFixedAssetRolesBuilder method execute.
@Override
protected void execute(ExecutionContext executionContext) {
checkParam("person", executionContext, Person.class);
// party roles
PersonPartyRolesBuilder personPartyRolesBuilder = new PersonPartyRolesBuilder();
partyRoles = personPartyRolesBuilder.setPerson(person).addPartyRoleTypes(fixedAssetRoleSpecs.stream().map(x -> x.roleType).collect(Collectors.toList())).build(this, executionContext).getObject();
// fixed asset roles
for (FixedAssetRoleSpec spec : fixedAssetRoleSpecs) {
final Property property = spec.getProperty();
final FixedAssetRole fixedAssetRole = property.addRoleIfDoesNotExist(person, spec.roleType, null, null);
object.add(fixedAssetRole);
}
}
Aggregations