A change and a note for future change related to receiving duplicate messages
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@562284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -24,6 +24,14 @@ under the License.
|
||||
<simple-method method-name="createOagisMessageInfo" short-description="Create MessageInfo">
|
||||
<make-value entity-name="OagisMessageInfo" value-name="newEntity"/>
|
||||
<set-pk-fields map-name="parameters" value-name="newEntity" />
|
||||
|
||||
<!-- make sure it doesn't already exist: motivation: if it already exists we'll get a HUGE error message on the create with the whole XML file in it if debug is on for that, so we want a smaller error message -->
|
||||
<find-by-primary-key map-name="newEntity" value-name="currentOagisMessageInfo"/>
|
||||
<if-not-empty field-name="currentOagisMessageInfo">
|
||||
<add-error><fail-message message="This message was already received, ie we have a duplicate combined ID for the message: ${newEntity}"/></add-error>
|
||||
<check-errors/>
|
||||
</if-not-empty>
|
||||
|
||||
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
|
||||
<create-value value-name="newEntity"/>
|
||||
<!--if-compare value="1" field-name="newEntity.confirmation" operator="equals" type="Integer">
|
||||
|
||||
@@ -370,6 +370,8 @@ public class OagisServices {
|
||||
String bsrVerb = UtilXml.childElementValue(bsrElement, "of:VERB");
|
||||
String bsrNoun = UtilXml.childElementValue(bsrElement, "of:NOUN");
|
||||
|
||||
// TODO: before dispatching the message, make sure the combined ID (primary of OagisMessageInfo entity) is not in the database, ie hasn't been received already
|
||||
|
||||
if (bsrVerb.equalsIgnoreCase("CONFIRM") && bsrNoun.equalsIgnoreCase("BOD")) {
|
||||
try {
|
||||
serviceResult = dispatcher.runSync("receiveConfirmBod", UtilMisc.toMap("document",doc));
|
||||
|
||||
Reference in New Issue
Block a user