Like Johan says, that is normal behavior. The create batch and the changebatch will never execute any events (only validationrules can be checked)
Johan gave two solutions:
- Use Core.commit instead of the CreateBatch (will be slower).
- Define the logic of the before commit event in your Java action (before you create the object using CreateBatch.create).
There is another way of doing this. You could keep your commit microflow because your probably want it to be executed when a user commits the object as well. And creating the logic twice can only result in mistakes or differences between the two.
You can just call the microflow from your java like this:
Map<String,Object> paramMap = new HashMap<String, Object>(); paramMap.put("InputObject", batch.getMendixObject()); Core.execute(this.context, "ModuleName.BCo_Objectname", paramMap);
This is normal behaviour. The CreateBatch does not trigger object events. If you want to have events triggerd please do the following:
Core.commitinstead of the CreateBatch (will be slower).