Trigger ModelValidator at the very end of the Event

55 views
Skip to first unread message

Avian Driyanto

unread,
Aug 13, 2025, 12:46:57 AMAug 13
to iDempiere
Hi all,

In my company, we use idempiere plugin template for developing plugin we named as Custom. In there, we add some validation in Event beforeComplete() of MOrder and some Calculation in Event afterComplete() of MOrder too.

we have another plugin, that is still using ModelValidator, that you must register first on Tabel AD_ModelValidator. This ModelValidator, only will be trigger on EVENT afterComplete() of MOrder. I want separate it from CUSTOM, because i don't want the code become so Large in Custom. The problem is, there's some calculation that happen in Package Custom, that has impact on this ModelValidator Plugin. SO, in the SeqNo of the AD_ModelValidator, i put 100 on SeqNo. Hopefully, i will trigger at the last Cycle of event AFTERCOMPLETE of MOrder.

But after i try that, its not working. The Custom always trigger at the very end. not the Validator.

So, is there a ways to solve this?

Regards,
Avian Driyanto

Heng Sin Low

unread,
Aug 13, 2025, 1:41:23 AMAug 13
to idem...@googlegroups.com
No, that wouldn't work, you need to move the model validator to event handler too (or move the event handler to model validator).

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/idempiere/b8074028-69f6-490b-bf15-a76668fea838n%40googlegroups.com.

Avian Driyanto

unread,
Aug 13, 2025, 2:43:18 AMAug 13
to iDempiere
Hi Hengsin, thanks for you answer. OK if i'm not using ModelValidator, i'm changing it to EventHandler can i still make this Plugin executed in the last cycle after the Custom Plugin? 

Regards,
Avian Driyanto

Heng Sin Low

unread,
Aug 13, 2025, 2:56:04 AMAug 13
to idem...@googlegroups.com
you can try to order it using the service.ranking property

Avian Driyanto

unread,
Aug 13, 2025, 2:58:21 AMAug 13
to iDempiere
Hi Hengsin, i'll try that.

Thanks for your answer,

Regards,
Avian Driyanto

Avian Driyanto

unread,
Aug 13, 2025, 4:17:15 AMAug 13
to iDempiere
Hi Hengsin, using Event Handler and Ordering it using service.ranking solve my problem.
Thanks before,


Regards,
Avian Driyanto

Avian Driyanto

unread,
Aug 17, 2025, 10:13:32 PMAug 17
to iDempiere
Hi Hengsin, why after i restart my Eclipse the service.ranking is not working? Earlier it works, can i check queue of event handler from 2 diffrent plugin?
in the ModelValidator, we can check it on Window Model Validator or directly on Table AD_ModelValidator. 

Regards, 
Avian Driyanto

Avian Driyanto

unread,
Aug 17, 2025, 10:35:44 PMAug 17
to iDempiere
Screenshot 2025-08-18 092932.png
Screenshot 2025-08-18 092819.png
Sorry i need to hide some of the information, 
the name of the plugin lets say,
plugin.balance, and plugin.custom. These two my main focus, i want balance to running after the custom. At first, using service.ranking it works. But after i restart eclipse, dan try to Test it again. It not working, always Custom is running at the end.
I Check on the Felix console, in the services rangking it not show anything. Any helps really need it, by the way i'm using idempiere ver 7.1

Regars,
Avian Driyanto

Avian Driyanto

unread,
Aug 17, 2025, 11:56:05 PMAug 17
to iDempiere
Hi all,

I Think the problem is in the eclipse, i test it with 2 case :
After starting Eclipse, and later the project is open without refreshing the project i running the server.product. This step, make the service.ranking not working, but if i refresh the project first then running server.product the service.ranking is working. Does anyone know why this happen?


Regards,
Avian Driyanto
Reply all
Reply to author
Forward
0 new messages