This project has moved and is read-only. For the latest updates, please go here.

Controlling Instruction Execution Order

May 13, 2014 at 4:08 PM
I have a requirement where I want my instructions to execute in the order that they are added in the rule. I am using a custom instruction followed by the add namespace instruction.

When the instructions are executed the add namespace instruction is executed first then my custom instruction, which is not the order I had expected.

Is there a way to control the execution order?

BTW, Thanks for the great work on this framework. I am finding it to be very useful.
May 14, 2014 at 12:52 PM
Hi guessmyname,

Thank you for the invaluable feedback. Your requirement is impossible to implement with v1.4 of the framework without some workarounds. The reason for this is that Instructions are fired first in alphabetical order of the containing MetaInstruction class name and then by rule order. In order to meet your requirement you would need to copy methods from out of the box MetaInstructions (you can continue to use out of the box Instructions) to your custom one with corresponding BRE vocabulary definitions and use those along with your methods to create custom Instructions. In this case the rule order will be respected including across rules if each rule is given an appropriate priority.

I will cater for this requirement in v1.5, hopefully due sometime in June so look out for that and let me know if you'd like to be a beta tester.

Marked as answer by jcooper1982 on 5/25/2014 at 9:13 PM
Jun 29, 2014 at 11:16 PM
This is fixed in v1.5 of the framework, give it a try.