how to fetch process Definition all variables

cancel
Showing results for 
Search instead for 
Did you mean: 
amruta_w
Senior Member

how to fetch process Definition all variables

Hello All,

I want to fetch all process Definition variables from process Definition Key !!

is there any documentation , API or Example please provide asap.

4 Replies
amruta_w
Senior Member

Re: how to fetch process Definition all variables

@bassam_al-saror please help me to find this. Thanks in advance.

abbask01
Senior Member

Re: how to fetch process Definition all variables

you can only query varirables from a particular execution, create a native query instead of using the Java API

Regards,
Abbas
amruta_w
Senior Member

Re: how to fetch process Definition all variables

I am trying to get the process definition variables before creating the process instance, if you have worked like this scenario or any idea to get variables kindly help me out. Thanks in advance.

amruta_w
Senior Member

Re: how to fetch process Definition all variables

Hi @abbask01 ,

I have tried the following way to get variables from form table but i'm unable to get the variables, kindly help me out if have any idea

List<Execution> variables = runtimeService.createNativeExecutionQuery().sql("select _FORM.*" +
		        "  from  form _FORM" +
		        " where app_definition_id ="+appDefinitionId+" and name like '%closed edit readonly%'").list();
		List<Map<String, Object>> customTaskList = new ArrayList<>();
	    for (Execution vars : variables) {
	        Map<String, Object> map = new LinkedHashMap<>();
	        map.put("variableId", vars.getId());
	        map.put("variableName", vars.getName());
	        map.put("variableDescription", vars.getDescription());
	        customTaskList.add(map);
	    }
	    System.out.println("printing list");
	    customTaskList.forEach(System.out::println); 

 

Thanks & Regards

Amruta Wandakar