From 4f75965d324b53b4d2f11f1c974631817cb81aad Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Wed, 24 Jun 2020 23:03:14 +0200 Subject: [PATCH] fixed correct handling of messaging field mappings Issue #71 --- .../imixs/bpmn/ImixsActorMappingAdapter.java | 13 ++++++-- .../org/imixs/bpmn/ImixsRuntimeExtension.java | 32 +++++++++++++------ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsActorMappingAdapter.java b/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsActorMappingAdapter.java index 9c4e49c..82ac3a8 100644 --- a/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsActorMappingAdapter.java +++ b/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsActorMappingAdapter.java @@ -159,6 +159,15 @@ private void updateDeprecatedValue(String deprecatedValue, String newValue) { allItems.addAll(ImixsBPMNPlugin.findAllItemsByName((Definitions) imixsElement, "keyAddReadFields")); allItems.addAll(ImixsBPMNPlugin.findAllItemsByName((Definitions) imixsElement, "keyAddWriteFields")); + // test messaging settings. + allItems.addAll(ImixsBPMNPlugin.findAllItemsByName((Definitions) imixsElement, "keymailreceiverfields")); + allItems.addAll(ImixsBPMNPlugin.findAllItemsByName((Definitions) imixsElement, "keymailreceiverfieldscc")); + allItems.addAll(ImixsBPMNPlugin.findAllItemsByName((Definitions) imixsElement, "keymailreceiverfieldsbcc")); + + // time compare filed + allItems.addAll(ImixsBPMNPlugin.findAllItemsByName((Definitions) imixsElement, "keytimecomparefield")); + + for (Item item: allItems) { // test if the value is part of this item... @@ -166,12 +175,12 @@ private void updateDeprecatedValue(String deprecatedValue, String newValue) { for (Value value : valueList) { if (value.getValue().equals(deprecatedValue)) { if (newValue == null) { - logger.info("...remove drepecated value '" + deprecatedValue + "' from item " + item.getName() + logger.info("...remove deprecated value '" + deprecatedValue + "' from item " + item.getName() + "..."); valueList.remove(value); break; } else { - logger.fine("...update drepecated value '" + deprecatedValue + "' from item " + item.getName() + logger.fine("...update deprecated value '" + deprecatedValue + "' from item " + item.getName() + " -> " + newValue + "..."); // we need to update the deprecated value with the new value! int i = valueList.indexOf(value); diff --git a/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsRuntimeExtension.java b/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsRuntimeExtension.java index b244884..c716318 100644 --- a/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsRuntimeExtension.java +++ b/org.imixs.eclipse.bpmn2.plugin/src/org/imixs/bpmn/ImixsRuntimeExtension.java @@ -99,23 +99,29 @@ public void notify(LifecycleEvent event) { */ private void validateDeprecatedFieldMappings(EObject object) { - // test for deprecated fieldMappings... + // test for deprecated fieldMappings for Task elements... if (ImixsBPMNPlugin.isImixsTask(object) || ImixsBPMNPlugin.isImixsCatchEvent(object)) { - removeDeprecatedActorEntries(object, "keyownershipfields", "txtFieldMapping"); - removeDeprecatedActorEntries(object, "keyaddwritefields", "txtFieldMapping"); - removeDeprecatedActorEntries(object, "keyaddreadfields", "txtFieldMapping"); + removeDeprecatedFieldMappings(object, "keyownershipfields", "txtFieldMapping"); + removeDeprecatedFieldMappings(object, "keyaddwritefields", "txtFieldMapping"); + removeDeprecatedFieldMappings(object, "keyaddreadfields", "txtFieldMapping"); } - // test for deprecated time fields... + // test for deprecated fieldMappings for Event elements + if (ImixsBPMNPlugin.isImixsCatchEvent(object)) { - removeDeprecatedActorEntries(object, "keytimecomparefield", "txttimefieldmapping"); + // test timer settings + removeDeprecatedFieldMappings(object, "keytimecomparefield", "txttimefieldmapping"); + // test messaging settings. + removeDeprecatedFieldMappings(object, "keymailreceiverfields", "txtFieldMapping"); + removeDeprecatedFieldMappings(object, "keymailreceiverfieldscc", "txtFieldMapping"); + removeDeprecatedFieldMappings(object, "keymailreceiverfieldsbcc", "txtFieldMapping"); } } /** * Validates a specific item for deprecated FieldMappings. The method can - * validate field mappings from different soruces. Currently 'txtFieldMapping' + * validate field mappings from different sources. Currently 'txtFieldMapping' * for actors and 'txttimefieldmapping' for Time Fields are known. * * @param object @@ -123,7 +129,7 @@ private void validateDeprecatedFieldMappings(EObject object) { * @param itenName * - name of the value to validate */ - private void removeDeprecatedActorEntries(EObject object, String itenName, String mappingSource) { + private void removeDeprecatedFieldMappings(EObject object, String itenName, String mappingSource) { // we can not cache the fieldMapping here! // We need to load for each BaseElement separately because we do not know in @@ -143,7 +149,15 @@ private void removeDeprecatedActorEntries(EObject object, String itenName, Strin // test if value still is defined if (!fieldMappings.containsKey(entry.getValue())) { - logger.info("...remove deprecated fieldmapping '" + itenName + "' : " + entry.getValue()); + String objectType=""; + if (ImixsBPMNPlugin.isImixsTask(object)) { + objectType="ImixsTask"; + } + + if (ImixsBPMNPlugin.isImixsCatchEvent(object)) { + objectType="ImixsEvent"; + } + logger.info("... " + objectType + ": remove deprecated fieldmapping '" + itenName + "' : " + entry.getValue()); deprecatedList.add(entry); } }