Rev 1653 | Rev 1775 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1653 | jmachado | 1 | package pt.estgp.estgweb.domain; |
2 | |||
1699 | jmachado | 3 | import pt.estgp.estgweb.services.bpmnprocess.types.DomainRoleProxy; |
4 | |||
1653 | jmachado | 5 | /** |
6 | * Created by jorgemachado on 03/02/17. |
||
7 | */ |
||
1699 | jmachado | 8 | public class BpmnActorPoolImpl extends BpmnActorPool |
9 | { |
||
10 | public boolean hasRole(1.5.0/docs/api/java/lang/String.html">String r) |
||
11 | { |
||
12 | if (r == null || getDomainRolesProxy() == null || getDomainRolesProxy().getRoles() == null || getDomainRolesProxy().getRoles().size() == 0) |
||
13 | return false; |
||
14 | for (DomainRoleProxy role : getDomainRolesProxy().getRoles()) |
||
15 | { |
||
16 | if (role.getRole().equals(r)) |
||
17 | return true; |
||
18 | } |
||
19 | return false; |
||
20 | } |
||
21 | |||
22 | public void replaceRole(1.5.0/docs/api/java/lang/String.html">String oldRole,1.5.0/docs/api/java/lang/String.html">String newRole) |
||
23 | { |
||
24 | if (oldRole == null || newRole == null || getDomainRolesProxy() == null || getDomainRolesProxy().getRoles() == null || getDomainRolesProxy().getRoles().size() == 0) |
||
25 | return; |
||
26 | for (DomainRoleProxy role : getDomainRolesProxy().getRoles()) |
||
27 | { |
||
28 | if (role.getRole().equals(oldRole)) |
||
29 | { |
||
30 | role.setRole(newRole); |
||
31 | break; |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 | |||
36 | |||
1653 | jmachado | 37 | } |