Validating input/output parameters before deployment

Hi

We allow users to create new processes using the graphical editor and some custom predefined tasks.

Before deploy we would like to validate that certain mandatory parameters are present for each task and were declared as input/output parameters in the graphical editor.

I tried listing tasks from a BpmnModelInstance and then using the taskService.getVariables() but it doesn’t work as the tasks were not deployed yet.

Do you know how to get a listing of all the input/output params for a task before deployment?
I have the bpmn source and a BpmnModelInstance available.

Thanks in advance for your help

Finally I found how to obtain input/output params, just leaving a code snippet in case it helps someone in the future.

		Collection<ServiceTask> tasks = modelInstance.getModelElementsByType(ServiceTask.class);
	
	for(ServiceTask task : tasks) {			

		ExtensionElements extension = task.getExtensionElements();
		
		Collection<ModelElementInstance> elements = extension.getElements();
		
		System.out.println("-------------- Input params for task: " + task.getName());
		
		for(ModelElementInstance element:elements) {
			
			if(element.getClass() == CamundaInputOutputImpl.class) {
				CamundaInputOutput x = (CamundaInputOutput)element;
				Collection<CamundaInputParameter> inputParams = x.getCamundaInputParameters();
				
				for (CamundaInputParameter inputParam : inputParams) {
					System.out.println(inputParam.getCamundaName());
				}
			}
			
		}
					
	}