About the JavaComputeTransform sample
This sample demonstrates how a JavaCompute node can be used to process simple invoices, by reading
input messages and producing new output messages.
Two JavaCompute nodes are provided, one of which uses XPath expressions (JavaComputeTransformXPath),
and one of which uses the Java Plugin Node API (JavaComputeTransformNoXPath).
This sample provides a
comparison between the two different approaches, which achieve the same results.
The JavaComputeTransformXPath sample completes the following tasks:
- Uses the XPathOperation helper class to set up iterative operations,
which creates the following items:
- Articles for each invoice
- Statements for each invoice
- An output invoice for each input invoice
- Extracts fields from the input message, by using XPath expressions.
- Propagates the output message to the Out terminal of the JavaCompute node.
The JavaComputeTransformNoXPath sample completes the following tasks:
- Uses the ForEachChildOperation helper class to set up iterative operations,
which creates the following items:
- Articles for each invoice
- Statements for each invoice
- An output invoice for each input invoice
- Uses Java Plugin API methods to navigate the input message and extract data from it.
- Propagates the output message to the Out terminal of the JavaCompute node.
The following WebSphere MQ queues are created by the sample:
- JAVACOMPUTE.TRANSFORMXPATH.IN
- JAVACOMPUTE.TRANSFORMXPATH.OUT
- JAVACOMPUTE.TRANSFORMXPATH.FAILURE
- JAVACOMPUTE.TRANSFORMNOXPATH.IN
- JAVACOMPUTE.TRANSFORMNOXPATH.OUT
- JAVACOMPUTE.TRANSFORMNOXPATH.FAILURE
The following message flows, JavaComputeTransformXPathFlow and
JavaComputeTransformNoXPathFlow, are imported by the sample:

Back to About the JavaCompute Node sample