Actually I looked further and found there are no calls to the getter or setter of variables on ProcessDefinitionEntityImpl in the engine. I thought that if the variables were defined in the process definition xml then they would at least be linked to the process definition entity but now I'm thinking not. The most relevant-looking tests actually just go through the runtimeService to get variables from the running instance after starting (Activiti/VariableScopeTest.java at develop · Activiti/Activiti · GitHub with XML at Activiti/activiti-engine/src/test/resources/org/activiti/engine/test/db at develop · Activiti/Activi... ). My impression is that this is a gap.
I've also done a bit of code research and would like to make sure I havent missed anything.
Am I correct in that there is currently no way to get / lookup Process Variables of a ProcessDefinition? (Weither required or not is not important at this time).
Is so, I guess I'll have to find a way to make a database for holding these in parallel to the deployed processDefinitions.
Thanks for your input.
If your goal is only to define a list of variables used in the process in the process, I think that Data objects is optimal.
https://www.activiti.org/userguide/#dataobjects
And, you can get that list by the following code.
List<ValuedDataObject> dataObjects = repositoryService.getBpmnModel("processDefinitionId").getProcessById("processDefinitionKey").getDataObjects();
for(ValuedDataObject dataObject: dataObjects){
System.out.println(dataObject.getId());
System.out.println(dataObject.getName());
System.out.println(dataObject.getType());
} ad
Ah thanks, tried around a bit with those, hadnt had the idea to get them via the bpmn model.
Yeah getting that far is atleast a good first step for my usecase, I'll be able to build up on top of that.
Thanks alot for your help.
Might be a stupid Question, but: Am I correct in that the DataObjects can only be defined programmatically or in the xml file ? and not in the Activiti Editor?
Thanks
All you can use.
Hm okay, didnt find it in the editor, strange. Okay I'll have a look again.
Thank you.
I'm sorry that Data Object setting diappear from Activiti Editor...
Ok, thanks for the info, no worries.
I'll just define the data objects in xml.
Thanks again.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.