Hello,
You both are correct. BDM is supposed to be updated only on an operation.
But, thanks to Bonita, there is still a way! But I would not recommend it.
First, how do you know one task is assigned? You have to possibility.
1/ by a Cron. You run this job every 10 mn, checking the assigned task, then update your BDM (see below). I would recommend creating a new job in Truckmilk (https://community.bonitasoft.com/project/pagetruckmilk-execute-jobs-intervalle) to do that (then you already have all the infrastructure, administration...).
2/ via the Event Handler mechanism (https://documentation.bonitasoft.com/bonita/7.11/event-handlers) . You register on the event "assigned" and you can do what you want. Attention, using the event handler:
* you have to configure the server
* the event handler is then called for every assigned task, whatever the process
* you are at the bottom of the engine. A transaction on the engine database is then already opened, maybe a transaction on the BDM database too, you have to check
* you are in a critical section for the engine. That's means, if your code is long, it can block all the Bonita Engine
* according to the event handler strategy, if you throw an exception, the operation is canceled. So, pay attention to catch all your exception and to not throw then if you don't want to abort the transaction (or if you want to abort the assignment, this is the way)
Saying that the event handler is a great mechanism.
---------------------------------
So, how could you update the BDM?
In the Bonita spirit, only an operation can update the BDM. That the reason why you don't have any API to update a BDM variable?. Saying that, the Bonita Engine has some internal API (attention, you are "behind the miror" here : theses API may be not stable between version). have a look to the MoonRover page (https://community.bonitasoft.com/project/pagenoonrover-access-your-bdm-and-query-it) , this page update existing BDM variable with the API (and this page does not works after 7.10, something change and we hae to review this part ;-0 ).
Second, BDM is a database, you can try to update it in SQL via JDBC. Get the Datasource via the BonitaProperties library (https://community.bonitasoft.com/project/bonita-properties).
Attention then: this is definitively not recommended, and not supported. Secondly, pay attention to release properly the BDM connection, because the Bonita Engine uses it. Then, the Bonita Engine and Hibernate may use caches: you change directly via SQL will not update any cache.
This is a lot of information, sorry about that, hope this helps