BP Fault XML Log adapter
The BP Fault XML Log adapter provides a custom log to a business process that can read a created log for formatting or processing.
The following table provides an overview of the BP Fault XML Log adapter:
|Graphical Process Modeler (GPM) category||All Services|
|Description||Enables a business process writer to log business-specific messages to a file in XML format. Each log item is an XML document fragment.|
|Business usage||Use this service to provide a custom log to a business process. This can also be used to read a created log for formatting or processing.|
|Usage example||You have written a large BPML to process widgets, and would like to provide feedback to a log to track the processing or any faults that occur. The XML generated can be read for formatting. A typical read example would be a read and format into HTML using XSLT.|
|Requires third-party files?||None|
|Platform availability||All supported platforms|
|Application requirements||Designate a location on disk to send and view logs.|
|Initiates business processes?||No|
|Invocation||Must be a step in the business process or in the on-fault handler.|
|Business process context considerations||For WRITE operations: When set to fail on error, the business process context status will be set to ERROR.|
|Returned status values||
Returned status values:
Note: For WRITE operations, this adapter will always return a status of “Success” because it is typically a non-critical part of a business process. If a failure occurs it is logged, but the business process continues.
Implementing the BP Fault XML Log adapter
- Create a BP Fault XML Log adapter configuration.
- Configure the BP Fault XML Log adapter.
- Use the BP Fault XML Log adapter in a business process.
Configuring the BP Fault XML Log adapter
To configure the BP Fault XML Log adapter, you must specify field settings in the GPM:
|Config||Name of the service configuration.|
|action||Valid values are:
|combineLog||Valid values are:
|fail-on-error||Whether to cause the business process to fail if an error is logged. Optional. Valid values are True and False. Used for WRITE operations only. If this parameter is set to True, and the log-level parameter is set to ERROR, the business process status is set to Error and the business process advanced status is set to the value in the log-message. This enables you to force a business process to fail (based on invalid business process data), when it may have ordinarily succeeded.|
|includeBody||Whether to include the body of the data with the
error message. Required. Used for WRITE operations only. When the
body is included, only the first 2048 bytes are included. Valid values
|log-level||Type of log. Required. Used for WRITE operations
only. Values are:
Note: You can add custom log levels to this list in the GPM, or by editing a business process in the business process editor.
|log-message||Message that you want to send to the log. Required. Used for WRITE operations only.|
|loggerName||Name of the log. Required. The file created in the Logger Output Path is given this name and an extension of .log. Used for both READ and WRITE operations.|
|loggerPath||Path used to write the log to a file. Required. Used for both READ and WRITE operations. Valid value is a valid full path.|
|logType||Select type of log. Required. Used for WRITE operations only. Valid values are Normal and Rolling.|
|maxLogSize||Maximum log size for rolling in bytes. Required if you selected Rolling as the log type in the service configuration. Used for WRITE operations only. Valid value is a number greater than zero.|
Business Process Example
The following example shows how the BP Fault XML Log adapter could be used in a business process:
<process name="default"> <operation name="BPFaultLogXML"> <participant name="mybpfaultxmllog"/> <output message="BPFaultLogXMLInputMessage"> <assign to="action">WRITE</assign> <assign to="combineLog">false</assign> <assign to="fail-on-error">true</assign> <assign to="includeBody">true</assign> <assign to="log-level">DEBUG</assign> <assign to="log-message">hello log</assign> <assign to="loggerName">testlog.log</assign> <assign to="loggerPath">/home/user/</assign> <assign to="logType">normal</assign> <assign to="." from="*"></assign> </output> <input message="inmsg"> <assign to="." from="*"></assign> </input> </operation> </process>