Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence of triggered flows is not working as expected #51

Open
toosting opened this issue Dec 23, 2022 · 3 comments
Open

Sequence of triggered flows is not working as expected #51

toosting opened this issue Dec 23, 2022 · 3 comments

Comments

@toosting
Copy link

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.

@pimvdnoll
Copy link

pimvdnoll commented Jan 3, 2023

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

@j3lte
Copy link

j3lte commented Jan 3, 2023

@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).

@pimvdnoll
Copy link

oeh nice :) looking forward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants