WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Creating a new message using a PHPCompute node

Create a new output message by using the PHPCompute node.

When you use a PHPCompute node to create a new output message, the code required depends on whether the annotated evaluate method is defined in the PHP script.

If you use the @MessageBrokerSimpleTransform annotation, the new output message and message assembly objects are created automatically. For example:

<?php

class MyNode {

	/**
	 * @MessageBrokerSimpleTransform
	 */
	function evaluate($output_assembly, $input_assembly) {
		// $output_assembly refers to the new message
	}
}

?>

If you use a plain script without an annotated evaluate method, you must create the output message and message assembly objects explicitly:

<?php

// the output message must be created explicitly
$output_message = new MbsMessage();

// a new output message assembly must be created to hold this new message
$output_assembly = new MbsMessageAssembly($assembly, $output_message);

?>
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:46:35


Task topicTask topic | Version 8.0.0.7 | ac69040_