See information about the latest product version
@MessageBrokerLocalEnvironmentTransform
Use the @MessageBrokerLocalEnvironmentTransform annotation to alter the behavior of the evaluate method in a PHP class.
The @MessageBrokerLocalEnvironmentTransform is similar to the @MessageBrokerSimpleTransform annotation but creates a copy of the local environment tree in the output assembly.
If the @MessageBrokerLocalEnvironmentTransform is used, nodes downstream of the PHPCompute node see changes to the local environment. If the @MessageBrokerLocalEnvironmentTransform is not used, the node can still modify the local environment, and all nodes in the flow (including upstream nodes) can see the changes.
The following example populates two new folders in the local environment tree, and copies the Wildcard subtree from the local environment into the output message:
<?php
class LocalEnvironmentTest {
/**
* Test local environment messages.
*
* @MessageBrokerSimpleTransform
* @MessageBrokerLocalEnvironmentTransform
*/
function evaluate($output_assembly, $input_assembly) {
$output_assembly[MB_LOCAL_ENVIRONMENT]->Folder1 = 'some string';
$output_assembly[MB_LOCAL_ENVIRONMENT]->Folder2->SubFolder =
'another string';
$output_assembly->XMLNSC->Message->InputLocalEnvironment =
$input_assembly[MB_LOCAL_ENVIRONMENT]->Wildcard;
}
}
?>