Rev 1699 | Rev 1776 | 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 | { |
||
1775 | jmachado | 12 | if (r == null || getSelectorRole() == null || getSelectorRole().getRoles() == null || getSelectorRole().getRoles().size() == 0) |
1699 | jmachado | 13 | return false; |
1775 | jmachado | 14 | for (DomainRoleProxy role : getSelectorRole().getRoles()) |
1699 | jmachado | 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 | { |
||
1775 | jmachado | 24 | if (oldRole == null || newRole == null || getSelectorRole() == null || getSelectorRole().getRoles() == null || getSelectorRole().getRoles().size() == 0) |
1699 | jmachado | 25 | return; |
1775 | jmachado | 26 | for (DomainRoleProxy role : getSelectorRole().getRoles()) |
1699 | jmachado | 27 | { |
28 | if (role.getRole().equals(oldRole)) |
||
29 | { |
||
30 | role.setRole(newRole); |
||
31 | break; |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 | |||
36 | |||
1653 | jmachado | 37 | } |