I defined a query in a drools drl
file that returns a set (series) of objects as its result.
query "q0"
e: Facts()
end
My question is, in what order does the query return these objects? Is it in the order of their insertion in the working memory or in an arbitrary fashion?
The order of the firings of one rule or the order of facts returned with a query is undefined. Whatever order you may observe now, with the Drools release you have installed, may change with the next release.
If you need a certain order, I suggest you use Collections.sort applied to the result set.