use of org.estatio.module.party.dom.role.IPartyRoleType in project estatio by estatio.
the class StateTransitionService method createPendingTransition.
/**
* Has public visibility only so can be used in tests.
*
* <p>
* Should instead use {@link #trigger(Object, StateTransitionType, String, String)}.
* </p>
*/
@Programmatic
public <DO, ST extends StateTransition<DO, ST, STT, S>, STT extends StateTransitionType<DO, ST, STT, S>, S extends State<S>> ST createPendingTransition(final DO domainObject, final S currentState, final STT transitionType, final Person personToAssignToIfAny, final String taskDescriptionIfAny) {
final TaskAssignmentStrategy<DO, ST, STT, S> taskAssignmentStrategy = transitionType.getTaskAssignmentStrategy();
IPartyRoleType assignToIfAny = null;
if (taskAssignmentStrategy != null) {
assignToIfAny = taskAssignmentStrategy.getAssignTo(domainObject, serviceRegistry2);
}
return transitionType.createTransition(domainObject, currentState, assignToIfAny, personToAssignToIfAny, taskDescriptionIfAny, serviceRegistry2);
}
use of org.estatio.module.party.dom.role.IPartyRoleType in project estatio by estatio.
the class PersonRepository method findByRoleType.
@Programmatic
public List<Person> findByRoleType(final IPartyRoleType iPartyRoleType) {
PartyRoleType partyRoleType = iPartyRoleType.findOrCreateUsing(partyRoleTypeRepository);
final List<Party> parties = partyRepository.findByRoleType(partyRoleType);
return personsFor(parties);
}
Aggregations