VMware Cloud Community
satoshi_goto
Contributor
Contributor

How to deserialize the response object in Java REST SDK?

Is there any way to deserialize from the output of the WorkflowExecution?

I can execute the workflow successfully.

But the response is too difficult to parse to object.

Here is the snippet of my Java code to execute the vRO workflow:

val session: VcoSession = sessionFactory.newSession(authentication)
val workflowService: WorkflowService = new WorkflowService(session)
val executionService: ExecutionService = new services.ExecutionService(session)
 
val workflow: Workflow = workflowService.getWorkflow("workflow_uuid")
val context: ExecutionContext = new ExecutionContextBuilder()
val execution: WorkflowExecution = executionService.execute(workflow, context)
VcoSession session = sessionFactory.newSession(authentication);
WorkflowService workflowService = new WorkflowService(session);
ExecutionService executionService = new services.ExecutionService(session);
WorkflowExecution execution = executionService.execute(workflow, context);
Properties virtualMachine = new ParameterExtractor().fromTheOutputOf(execution).extractProperties("vm");
System.out.println(virtualMachine);

 

My wish is to deserialize virtualMachine to like com.vmware.vim.binding.vim.VirtualMachine.

(Properties class gives only getProperty method.)

Is there any example about deserialization of Java REST SDK,

Or the good way?

Thanks.

0 Kudos
0 Replies