Show TOC

BeanShellPipe PropertiesLocate this document in the navigation structure

BeanShellPipe is a scriptable pipe used to modify a message.

You can script the entire message or each field individually in Java, and use this component in incoming and outgoing flows. The scripting is implemented through BeanShell. Refer to http://www.beanshell.orgInformation published on non-SAP site for details.

ClassName: com.sybase.esp.adapter.scripting.BeanShellPipe

Property Description
MsgPreProcessor (Required) BeanShell script for this message. The script is applied to the message before any fields are processed.

The script has access to a message object type. The name of the variable is <message>. For example:

System.out.println("Message received; SDO array size= " + message.peekDataObjects().length);
MsgPostProcessor (Required) BeanShell script for this message. The script is applied to the message after all fields have been processed.

The script has access to a message object type. The name of the variable is message. For example:

System.out.println("Message sent; SDO array size= " + message.peekDataObjects().length);
Type++ (Required) The type of the data object that is received from the source component. For an incoming flow (one flowing into Event Stream Processor through an AsapSink component), this is the Event Stream Processor Base Stream name to be updated with the message.

For an outgoing flow (one originating from published data from a strean), this is the Event Stream Processor stream name that is publishing the data.

.PreProcessor (Optional) BeanShell script for this message type. The script is applied to the message before any fields are processed.

The script has access to a SimpleDataObject object type. The name of the variable is <sdo>. Typen is the name of the message type or stream as defined in the associated Type property. For example:

System.out.println("Got data for message type: " + sdo.getType().getName());
.PostProcessor (Optional) BeanShell script for this message type. The script is applied to the message after all fields have been processed.

The script has access to a SimpleDataObject object type. The name of the variable is <sdo>. Typen is the name of the message type or stream as defined in the associated Type property. For example:

System.out.println("Sending data for message type: " + sdo.getType().getName());
.AttName++ (Required) Field names contained in the associated message type. BeanShell scripting is required for this. If the field name does not exist in the received message type, a new field is created. Typen is the name of the message type or stream as defined in the associated Type property.
.Script (Optional) BeanShell script for this field. The script has access to a SimpleDataObject object type. The name of the variable is <sdo>. Typen is the name of the message type/stream as defined in the associated Type property.
AttNamex (Optional) Field name as defined in the associated AttName property. For example:
if (sdo.isPresent("Amount ") && sdo.getAttributeValue ("Amount")>0 {value="AC";} else {value="CO"}