Task #1510 » VymenikIsExternal.bpmn20.xml
1 |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
---|---|
2 |
<!--
|
3 |
Pravidlo zkontroluje vsechny kontrakty uzivale, mimo Default, vrati true pokud jsou vsechny externi
|
4 |
Input:
|
5 |
Entity entity
|
6 |
Ouptut:
|
7 |
Boolean - je externista
|
8 |
-->
|
9 |
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
10 |
xsi:noNamespaceSchemaLocation="IdmScript.xsd"> |
11 |
<code>vymenikIsExternal</code> |
12 |
<name>Vymenik is external</name> |
13 |
<body><![CDATA[ |
14 |
import eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto;
|
15 |
|
16 |
boolean isExterne = true;
|
17 |
def contracts = identityContractService.findAllByIdentity(entity.getId());
|
18 |
for(def c : contracts) {
|
19 |
if ("Default".equals(c.getPosition())){
|
20 |
continue;
|
21 |
}
|
22 |
if (!c.isExterne()){
|
23 |
isExterne = false;
|
24 |
return isExterne;
|
25 |
}
|
26 |
}
|
27 |
|
28 |
return isExterne;
|
29 |
]]></body> |
30 |
<type>groovy</type> |
31 |
<category>TRANSFORM_TO</category> |
32 |
<description>
|
33 |
Pravidlo zkontroluje vsechny kontrakty uzivale, mimo Default, vrati true pokud jsou vsechny externi |
34 |
Input: |
35 |
Entity entity |
36 |
Ouptut: |
37 |
Boolean - je externista |
38 |
</description>
|
39 |
<services>
|
40 |
<service>
|
41 |
<name>identityContractService</name> |
42 |
<className>eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmIdentityContractService</className> |
43 |
</service>
|
44 |
</services>
|
45 |
<allowClasses>
|
46 |
<allowClass>
|
47 |
<className>eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto</className> |
48 |
</allowClass>
|
49 |
</allowClasses>
|
50 |
</script>
|
51 |
|