Accessing Task Input/Output Schema
To access the input or output element declaration at runtime, you must initialize a mediation task report object MediationTaskNameReport. This object has the accessor methods to get the input or the output element declaration as XSDElementDeclaration.
The following code shows how to get the input or the output element schemas:
public void init() throws TaskLifeCycleFault { } public void destroy() throws TaskLifeCycleFault { } public N execute(final N input, final Exchange<N> exchange) throws TaskFault { <TaskName>MediationTask task = this.getContext().getTaskConfiguration(); TaskName>MediationTaskReport report = new <TaskName>MediationTaskReport(task); /Task input type as schema element declaration XSDElementDeclaration inputType = report.getCustomInputType(); //Task output type as schema element declaration XSDElementDeclaration outputType = report.getCustomOutputType(); return exchange.getMessageData();
Copyright © 2022. Cloud Software Group, Inc. All Rights Reserved.