Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0050421
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformmajoralways2022-10-05 14:262022-10-05 14:32
ReportervmromanosView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0050421: Push API payload generation when event is triggered

DescriptionAs far as I understand, right now the Push API works this way:

1. A push API event is triggered in the middle of a transaction, pointing to the object id. For example:
   SynchronizationEvent.getInstance()
        .triggerEvent("OBDOAPI_UpdateDOStatus", distributionOrder.getId());
2. The transaction finishes
3. The EDL request is executed sending the PUSH API event to the listeners. In the moment it is sent, the payload is generated and sent outside.


So the process is pure asynchronous, and this might lead to inconsistencies.
Real example:

We have two events related to Distribution Orders:
 * OBDOAPI_UpdateDOStatus --> which is triggered when a DO changes the status
 * OBDOAPI_UpdateDOQuantities --> which is triggered when any quantity in the DO changes when a goods movement is performed.

See this real flow:
1. A DO is confirmed.
 1.1 The OBDOAPI_UpdateDOStatus is launched with Confirmed status [OK]
2. A "skip delta" action is performed in the DO. This implies to do the following stuff in the same transaction:
 2.1 to create a goods movement. The OBDOAPI_UpdateDOQuantities is launched and the status is Closed [WRONG, at this point the status is Confirmed]
 2.2 to close the DO. The OBDOAPI_UpdateDOStatus is launched and the status is Closed [OK]



So the problem is at 2.1, where I was expecting to receive the Confirmed status, because in the moment it was triggered that was the status.
However, I'm receiving Closed status, because in the moment the EDL is executed, this is the status in the DB
Steps To ReproduceConfigure the preference AWO Close DO Issue automatically after Skip Delta = Y


Create a DOi with one line of 10 units
  --> #1.json# OBDOAPI_UpdateDOStatus is launched with status Confirmed [OK]


Generate the picking for 10 units and confirm it.

Generate the issue task, and confirm 3 units from AWO Frontend. Important: select Skip delta.
  ---> #2.json# OBDOAPI_UpdateDOQuantities is launched with 3 units and status Closed [WRONG: I'm expecting Confirmed Status at this point]
  ---> #3.json# OBDOAPI_UpdateDOStatus is launched with 3 units and status Closed


JSON files attached
Proposed SolutionWhen triggering the event, being able to indicate that I want to generate the payload at this exact moment, save it to the EDL, and use it when sending it to the subscribers.
TagsNo tags attached.
Attached Fileszip file icon refirstsmcpbug.zip [^] (2,343 bytes) 2022-10-05 14:26

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0050249 closedAtulOpenbravo Modules Close DO can be launched from two different places, creating problems in Push API 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2022-10-05 14:26 vmromanos New Issue
2022-10-05 14:26 vmromanos Assigned To => Triage Platform Base
2022-10-05 14:26 vmromanos File Added: refirstsmcpbug.zip
2022-10-05 14:26 vmromanos Modules => Core
2022-10-05 14:26 vmromanos Triggers an Emergency Pack => No
2022-10-05 14:27 vmromanos Relationship added related to 0050249
2022-10-05 14:32 vmromanos Steps to Reproduce Updated View Revisions


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker