IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

PHPCompute node

Use the PHPCompute node to route and transform an incoming message, using the PHP scripting language.

Support for the PHP scripting language is available on all operating systems on which IBM® Integration Bus is supported.

Purpose

The PHPCompute node can use the PHP scripting language to route and transform incoming messages.

Using this node, you can achieve the following goals:

  • Examine an incoming message and, depending on its content, propagate it unchanged to the node's output terminal.
  • Change part of an incoming message and propagate the changed message to the output terminal by using PHP.
  • Create and build a new output message that is independent of the input message by using PHP.

The PHPCompute node is contained in the Transformation drawer of the palette, and is represented in the IBM Integration Toolkit by the following icon:

PHPCompute node icon

Using the PHPCompute node in a message flow

Look at the following sample to see how to use this node:

You can view information about samples only when you use the product documentation that is integrated with the IBM Integration Toolkit or the online product documentation. You can run samples only when you use the product documentation that is integrated with the IBM Integration Toolkit.

Specifying PHP

Create PHP statements to customize the behavior of the PHPCompute node. For example, you can customize the node to create one or more output messages by using either new data or the content of an input message or database (unchanged or modified). For example, you might want to modify a value in the input message by adding a value from a database, and store the result in a field in the output message.

Create the PHP statements that you want in a PHP script file and ensure that it exists in the workspace before you associate it with the PHPCompute node.

If the required PHP script file exists, import it into the workspace before associating it with the PHPCompute node (see Importing files from the file system into the IBM Integration Toolkit).

If a PHP file does not exist for this node, create one in the project folder with a file extension of .php (for example, myfile.php). For more information about creating a PHP script file, see Creating PHP code for a PHPCompute node.

The PHPCompute node provides support for Simple Network Management Protocol (SNMP). The Management Information Base (MIB) files are installed during the installation of IBM Integration Bus, and their location is specified by the MIBDIRS environment variable.

Configuring the PHPCompute node

When you have put an instance of the PHPCompute node into a message flow, you can configure it. For more information about how to configure nodes, see Configuring a message flow node.

The properties of the node are displayed in the Properties view. All mandatory properties for which you must enter a value (the ones that do not have a default value defined) are marked with an asterisk in that view.

To configure the PHPCompute node:

  1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab.
  2. On the Basic tab, use the PHP script property to specify the name of the PHP file. Select the Invoke 'evaluate()' method in PHP class definition property if the code in your PHP script file includes an evaluate method.
  3. On the Parser options tab, select the Use XMLNSC compact parser for the XMLNS domain property to specify that the XMLNSC Compact Parser is used for messages in the XMLNS Domain.
  4. On the Validation tab, specify the parser validation properties of the node. For more information about validation, see Validating messages. For information about how to complete this tab, see Validation tab properties.

Terminals and properties

The PHPCompute node terminals are described in the following table.

Terminal Type Description
In Input data The input terminal that accepts a message for processing by the node.
Out Output data The output terminal to which the transformed message is routed.
Failure Output data The output terminal to which the message is routed if a failure is detected during the computation. Even if the Validate property is set, messages that are propagated to the Failure terminal of the node are not validated.
* (dynamic) Dynamic output Zero or more dynamic output terminals can be created to support message routing.

You can define additional dynamic output terminals on the PHPCompute node. Not all dynamic output terminals that are created on a PHPCompute node need to be mapped to an expression in the filter table. If any of the dynamic output terminals are unmapped, they never have messages propagated to them. Several expressions can map to the same single dynamic output terminal. No static output terminal exists to which the message is passed straight through. For more information about using dynamic terminals, see Using dynamic terminals.

The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the BAR file to deploy it).

The Description properties of the PHPCompute node are described in the following table:
Property M C Default Description
Node name No No PHPCompute The name of the node.
Short Description No No   A brief description of the node.
Long Description No No   Text that describes the purpose of the node in the message flow.

The Basic properties of the PHPCompute node are described in the following table:

Property M C Default Description mqsiapplybaroverride command property
PHP script Yes Yes   A string containing the name of the PHP script file. ScriptName

The Parser Options properties of the PHPCompute node are described in the following table.

Property M C Default Description
Use XMLNSC compact parser for XMLNS domain No No False This property controls whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. If you set this property, the message data appears under XMLNSC in nodes that are connected to the output terminal when the input MQRFH2 header or Input Message Parsing property, Message Domain, is XMLNS.

The Validation properties of the PHPCompute node are described in the following table.

For a full description of these properties, see Validation properties.

Property M C Default Description mqsiapplybaroverride command property
Validate No No None This property controls whether validation takes place. Valid values are:
  • None
  • Content and Value
  • Content
  • Inherit
validateMaster
Failure action No No Exception This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are:
  • User Trace
  • Local Error Log
  • Exception
  • Exception List
 
The Monitoring properties of the node are described in the following table.
Property M C Default Description
Events No No None Events that you have defined for the node are displayed on this tab. By default, no monitoring events are defined on any node in a message flow. Use Add, Edit, and Delete to create, change or delete monitoring events for the node; see Configuring monitoring event sources using monitoring properties for details.

You can enable and disable events that are shown here by selecting or clearing the Enabled check box.


ac69250_.htm | Last updated Friday, 21 July 2017