Question related to the variables

Hi,
According to the API documents,
we can start a process instance by this way
startProcessInstanceByKey(String processDefinitionKey, String businessKey, Map<String, Object> variables);
I assume a scenarios as follows
create an order base on the values from form inputs(also set to the variables object)
then after the order created, set the orderId to the businessKey.
then start the process instance by this api.

I think the values from form inputs will be inserted into the table act_ru_variable, and also act_hi_varinst even.
My question is that when using the taskService.getVariables or runtimeService.getVariable api, it will read the values from the act_ru_variable table, as I have also insert into my own order table, any setups that can make the api read the values from my own order table base on the businessKey?
or the businessKey is not for this design purpose? and only for lookup process instance by it through ProcessInstanceQuery#processInstanceBusinessKey(String) as the api doc

Hi Will,

it will read the values from the act_ru_variable table, as I have also insert into my own order table, any setups that can make the api read the values from my own order table base on the businessKey?

  1. You can call external API to manipulate external values (in you case order attributes). You can get bussinessKey easily org.flowable.engine.runtime.ProcessInstance#getBusinessKey.
  2. use JPA structures as process variables Open Source
  3. Another possibility is to extend persistence layer and use your “custom” structures to store order attributes as a process instance variables.

the businessKey is not for this design purpose?

I do not understand the question.

Regards
Martin