01: package org.osbl.riskmanagement.process;
02:
03: import org.concern.controller.AbstractActor;
04:
05: import org.osbl.riskmanagement.model.Risk;
06: import org.osbl.identity.model.Identity;
07: import org.osbl.identity.model.User;
08: import org.osbl.persistence.*;
09:
10: import java.util.*;
11:
12: public class Responsible extends AbstractActor<Risk> {
13: Persistence identityPersistence;
14:
15: public void setIdentityPersistence(Persistence identityPersistence) {
16: this .identityPersistence = identityPersistence;
17: }
18:
19: public Set<String> getAssignees(Risk subject, int level) {
20: /*PROTECTED REGION ID(org.osbl.riskmanagement.process.Responsible.getAssignees) ENABLED START*/
21: Identity responsible = subject.getType().getResponsible();
22: LoadCommand command = (LoadCommand) identityPersistence
23: .createCommand("load");
24: command.setType(User.class);
25: command.setId(responsible.getId());
26: User user = (User) command.execute();
27: return new HashSet<String>(Arrays.asList(user.getAccount()));
28: /*PROTECTED REGION END*/
29: }
30: }
|