Search in sources :

Example 6 with IPartyRoleType

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);
}
Also used : IPartyRoleType(org.estatio.module.party.dom.role.IPartyRoleType) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 7 with IPartyRoleType

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);
}
Also used : IPartyRoleType(org.estatio.module.party.dom.role.IPartyRoleType) PartyRoleType(org.estatio.module.party.dom.role.PartyRoleType) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Aggregations

IPartyRoleType (org.estatio.module.party.dom.role.IPartyRoleType)7 Person (org.estatio.module.party.dom.Person)3 PartyRoleType (org.estatio.module.party.dom.role.PartyRoleType)3 Programmatic (org.apache.isis.applib.annotation.Programmatic)2 Task (org.estatio.module.capex.dom.task.Task)2 List (java.util.List)1 Action (org.apache.isis.applib.annotation.Action)1 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)1 Organisation (org.estatio.module.party.dom.Organisation)1 PartyRole (org.estatio.module.party.dom.role.PartyRole)1 PartyRoleTypeService (org.estatio.module.party.dom.role.PartyRoleTypeService)1 LocalDateTime (org.joda.time.LocalDateTime)1 Before (org.junit.Before)1