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.
The PHPCompute node can use the PHP scripting language to route and transform incoming messages.
Using this node, you can achieve the following goals:
The PHPCompute node is contained in the Transformation drawer of the palette, and is represented in the IBM Integration Toolkit by the following icon:
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.
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.
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:
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).
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:
|
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:
|
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. |