mendixlabs / mendix-file-dropper

Mendix File Dropper (Mendix 8, React based, Webmodeler compatible)

Home Page:https://appstore.home.mendix.com/link/app/111497/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sequence of triggered flows is not working as expected

toosting opened this issue · comments

Hello,

On our project (Mendix v9.12.5) we encountered an issue with the usage of the combination of the OnAccept, AfterAccept and AfterCommit flow.

Expected behavior

The expected behavior would be the OnAccept action at first when the user uploads a file. If it meets the criteria (defined in the OnAccept) to enter the application then AfterAccept action would start. When this flow ends successfully, the BeforeCommit action can be started, then the file can be Committed and as last if it is required the AfterCommit can be triggered.

(Same idea for nanoflows of course : ) )

The issue(s)

The OnAccept flow works fine, if the logic returns an invalid then the whole process will stop accordingly and it will return the error message. However the AfterAccept and Before/After commit are not working properly. The aftercommit seems in every case that I tried to start before the AfterAccept, so if a file doesn’t fit the criteria (eg. due an invalid mime type, one of our checks) then you have already committed in the databbase and is the widget trying to set context in the aftercommit. During that moment the AfterAccept is also running parallel, or even triggered after the BeforeCommit or AfterCommit. In some of those cases the (System)File was removed from the database during or after the commit happened. Which causes several different issues (not at once) such as grey out FileDropper widget in the runtime, Mendix message that an object could not be changed due it not being in the database anymore etc.

Logging to show the sequence of flows, each flow is logged at start and finish. FileHelper is the OnAccept, LanguagePDF is the afterCommit and onAccept is the onAccept flow.

FileDropper_Logging

Looking forward to your reply, kind regards,

Thijs

ps: if you need more information or feedback feel free to message me.

Hi @j3lte can you take a look at this? :) is it that easy to change the order of executing microflows set in the widget?

@pimvdnoll @toosting Unfortunately I am no longer working on the File Dropper widget, as I am no longer part of Mendix per June '22. Furthermore, this widget is a custom widget, which is discouraged by Mendix (and results in unstable behavior I guess). Mendix seems to want to release their own Platform supported version of this, but when that is, is unclear. (I guess it is already +2 years on their roadmap...)

I do however plan on releasing my own Pluggable version of this widget, as is showcased here: https://caffcodecontenttestapp-sandbox.mxapps.io/p/fileupload-example1. I'm nearly done with that one, which will be released as a Module (because the widget needs some Nanoflow actions to be used).

oeh nice :) looking forward