cancel
Showing results for 
Search instead for 
Did you mean: 

how to fetch process Definition all variables

amruta_w
Star Collaborator
Star Collaborator

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 4

amruta_w
Star Collaborator
Star Collaborator

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

abbask01
Star Collaborator
Star Collaborator

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

Regards,
Abbas

amruta_w
Star Collaborator
Star Collaborator

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
Star Collaborator
Star Collaborator

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