Skip to content

Commit

Permalink
docu
Browse files Browse the repository at this point in the history
Issue #564
  • Loading branch information
rsoika committed Jan 3, 2024
1 parent ebff158 commit eaf7e84
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package org.imixs.workflow.office.gdpr;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.SignalAdapter;
import org.imixs.workflow.engine.DocumentService;
import org.imixs.workflow.engine.plugins.SplitAndJoinPlugin;
import org.imixs.workflow.exceptions.AdapterException;
import org.imixs.workflow.exceptions.PluginException;
import org.imixs.workflow.exceptions.ProcessingErrorException;
Expand All @@ -27,10 +29,10 @@
* {@code
*
* <gdpr>
<delete-items>$file, txtname</delete-items>
<anonymise-items>firstname,lastname</anonymise-items>
<delete>$file, txtname</delete>
<anonymise>firstname,lastname</anonymise>
<placeholder>no data</placeholder>
<anonymise-references>true@false</anonymise-references>
<references>IN|OUT|ALL|NONE</references>
</gdpr>
*
* }
Expand Down Expand Up @@ -77,25 +79,44 @@ public ItemCollection execute(ItemCollection workitem, ItemCollection event)
"missing gdpr configuraiton in BPMN event!");
}

// iterate over all gdpr configurations
// iterate over all gdpr configurations references
for (ItemCollection gdprConfig : gdprConfigList) {
String deleteItems = gdprConfig.getItemValueString("delete-items");
String anonymiseItems = gdprConfig.getItemValueString("anonymise-items");
List<String> outgoinReferences = new ArrayList<String>();

String deleteItems = gdprConfig.getItemValueString("delete");
String anonymiseItems = gdprConfig.getItemValueString("anonymise");
String placeholder = gdprConfig.getItemValueString("placeholder");
boolean anonymiseReferences = gdprConfig.getItemValueBoolean("anonymise-workitemref");
boolean anonymiseReferences = gdprConfig.getItemValueBoolean("references");

gdprAnonymiseService.deleteItems(workitem, deleteItems);
gdprAnonymiseService.anonimiseItems(workitem, anonymiseItems, placeholder);

// anonymise references?
if (anonymiseReferences) {
if ("OUT".equals(anonymiseReferences) || "ALL".equals(anonymiseReferences)) {
// anonymize all sub processes....
logger.info("...anonymise outgoing references...");
outgoinReferences = workitem.getItemValue(SplitAndJoinPlugin.LINK_PROPERTY);
for (String refid : outgoinReferences) {
ItemCollection refWorkitem = documentService.load(refid);
if (refWorkitem != null) {
gdprAnonymiseService.deleteItems(refWorkitem, deleteItems);
gdprAnonymiseService.anonimiseItems(refWorkitem, anonymiseItems, placeholder);
gdprAnonymiseService.save(refWorkitem);
}
}
}
if ("IN".equals(anonymiseReferences) || "ALL".equals(anonymiseReferences)) {
logger.info("...anonymise ingoing references...");
String searchTerm = "($workitemref:\"" + workitem.getUniqueID() + "\" )";
try {
List<ItemCollection> refList = documentService.find(searchTerm, 99999, 0);
for (ItemCollection refWorkitem : refList) {
gdprAnonymiseService.deleteItems(refWorkitem, deleteItems);
gdprAnonymiseService.anonimiseItems(refWorkitem, anonymiseItems, placeholder);
gdprAnonymiseService.save(refWorkitem);
// verify if not yet anonymized....
if (!outgoinReferences.contains(refWorkitem.getUniqueID())) {
gdprAnonymiseService.deleteItems(refWorkitem, deleteItems);
gdprAnonymiseService.anonimiseItems(refWorkitem, anonymiseItems, placeholder);
gdprAnonymiseService.save(refWorkitem);
}
}
} catch (QueryException e) {
throw new PluginException(e.getErrorContext(), e.getErrorCode(), e.getMessage(), e);
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/plugins/dmssplitplugin.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#The DMSSplitPlugin
# The DMSSplitPlugin

The DMSSplitPlugin provides functionality to create sub-process instances for
each attachment added in an origin process. The configuration is similar to
Expand Down
36 changes: 22 additions & 14 deletions src/site/markdown/plugins/gdpr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,47 @@ To trigger the process the following event-item definition is used:

```xml
<gdpr>
<delete-items>...</delete-items>
<anonymise-items>...</anonymise-items>
<delete>...</delete>
<anonymise>...</anonymise>
<placeholder>no data</placeholder>
<anonymise-workitemref>true|false</anonymise-workitemref>
<references>OUT|IN|ALL|NONE</references>
</gdpr>
```


- delete-items = list of items to be deleted
- anonymize-items = list of items to be anonymized
- delete = list of items to be deleted
- anonymise = list of items to be anonymized
- placeholder = test for anonymization
- anonymise-workitemref = recursive search of references
- references = recursive search of references

The item definition can contain a comma separated list of items as also a regular expression. See the following example:
The item definitions `delete` and `anonymise` can contain a comma separated list of items names as also a regular expression. See the following example:


```xml
<gdpr>
<delete-items>$file, cdtr.iban,dbtr.iban,cdtr.bic,dbtr.bic, $workflowsummary, $workflowabstract,txtworkflowhistory</delete-items>
<anonymise-items>(^contract\.|^loan\.)</anonymise-items>
<delete>$file, cdtr.iban,dbtr.iban,cdtr.bic,dbtr.bic, $workflowsummary, $workflowabstract,txtworkflowhistory</delete-items>
<anonymise>(^contract\.|^loan\.)</anonymise>
<placeholder>no data</placeholder>
<anonymise-workitemref>true</anonymise-workitemref>
<references>ALL</references>
</gdpr>
```

In the example above the items '$file, cdtr.iban,dbtr.iban,cdtr.bic,dbtr.bic, $workflowsummary, $workflowabstract,txtworkflowhistorye' will be deleted.
In the example above the items `$file, cdtr.iban,dbtr.iban,cdtr.bic,dbtr.bic, $workflowsummary, $workflowabstract,txtworkflowhistorye` will be deleted.
All items starting with `contract.` or `loan.` will be replaced with the place holder 'no data'.

All items starting with 'contract.' or 'loan.' will be replaced with the place holder 'no data'.

The item list can be customized for each event separately

### References

The tag `references` specifies if the adapter class should also anonymise ingoing or outgoing references. A reference is a workitem linked by the Item `$workitemref`.

- OUT = all direct refered workitems will be anonymised. These are typical workitems created by the [SplitAndJoinPliugin](https://www.imixs.org/doc/engine/plugins/splitandjoinplugin.html).
- IN = all workitems holding a reference to the current workitem. These are workitems with a simple unidirectional link to the current workitem in the item `$workitemref`.
- ALL = all ingoing and all outgoing refrences will be anonymised
- NONE = no rereferences will be anonymised (default)


### Placeholder Value

The item 'placeholder' can be used to define a placeholder value for the anoynmization process. If no placeholder is set, the value will be cleared.
The tag 'placeholder' can be used to define a placeholder value for the anoynmization process. If no placeholder is set, the value will be cleared.

5 changes: 5 additions & 0 deletions src/site/markdown/plugins/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The Microkernel Architecture Pattern

Imixs-Workflow provides a microkernel architecture pattern as an extension mechanism to the Imixs-Workflow Engine. The Imixs microkernel pattern allows you to add additional features to the Imixs-Workflow engine extending the processing cycle of a BPMN Event as well as a concept for separation and isolation.

Find more details in the sections [Plugin-API](https://www.imixs.org/doc/core/plugin-api.html) and [Adapter-API](https://www.imixs.org/doc/core/adapter-api.html).
9 changes: 8 additions & 1 deletion src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@

<item name="Text Adapter" href="textadapter/index.html" />
<item name="Text Blocks" href="textadapter/textblocks.html" />
<item name="Gdpr" href="gdpr.html" />


<item name="Plugins &amp; Adapters" href="plugins/index.html" collapse="true">
<item name="Comment Plugin" href="plugins/commentplugin.html" />
<item name="Sequencenumber Plugin" href="plugins/sequencenumberplugin.html" />
<item name="DMS Split Plugin" href="plugins/dmssplitplugin.html" />
<item name="GDPR Anonymiser" href="plugins/gdpr.html" />
</item>

<item name="Users &amp; Teams" href="teams/index.html" collapse="true">
<item name="User Profiles" href="teams/profile.html" />
Expand Down

0 comments on commit eaf7e84

Please sign in to comment.