Advanced Customization > Info*Engine User’s Guide > Task Webject Reference > Message Webjects > Query-Object
  
Query-Object
Retrieves a message from a JMS message queue. If there is no message to return, an instance of com.infoengine.exception.nonfatal.IERequestTimeOutException is thrown.
* 
This webject can be used only after your environment has been set up for messaging.
SYNTAX
<ie:webject name="Query-Object" type="MSG">
  <ie:param name="BLOB_COUNT" data="number"/>
  <ie:param name="DBUSER" data="username"/>
  <ie:param name="DELETE" data="[TRUE | FALSE]"/>
  <ie:param name="GET_BOOLEAN" data ="[TRUE | FALSE]"/>
  <ie:param name="GET_BYTE" data ="byte"/>
  <ie:param name="GET_BYTES" data ="bytes"/>
  <ie:param name="GET_CHAR" data ="char"/>
  <ie:param name="GET_DOUBLE" data ="double"/>
  <ie:param name="GET_FLOAT" data ="float"/>
  <ie:param name="GET_INT" data ="int"/>
  <ie:param name="GET_LONG" data ="long"/>
  <ie:param name="GET_SHORT" data ="short"/>
  <ie:param name="GET_STRING" data ="string"/>
  <ie:param name="PASSWD" data="password"/>
  <ie:param name="QUEUE" data="managed_queue_name"/>
  <ie:param name="WHERE" data="message_selector"/>
</ie:webject>
PARAMETERS
Required
Select
Optional
QUEUE
BLOB_COUNT
DBUSER
SERVICE
DELETE
GET_BOOLEAN
GET_BYTE
GET_BYTES
GET_CHAR
GET_DOUBLE
GET_FLOAT
GET_INT
GET_LONG
GET_SHORT
GET_STRING
PASSWD
WHERE
BLOB_COUNT
The number of BLOBs to return on the caller’s output stream. Any BLOBs not returned can be used as input to other tasks or webjects. The default for this parameter is 0. This parameter is optional.
DBUSER
The username to use when connecting to the MOM. If this parameter is specified, the parameter value takes precedence over any existing credentials mapping for the authenticated user, or any value specified in the .msg.username and .jms.username properties of the service that is used to connect to the MOM. For more information, see Credentials Mapping for MOMs.
If this parameter is omitted, the mapped credentials for the Info*Engine messaging software are used. If no such mapping is found, then the mapped credentials for the Java Messaging Service (JMS) are used. If neither of these mapped credentials are found, then the value set in the .msg.username property is used. If the .msg.username property is not set, then the value set in the .jms.username property is used. If neither property is set and you do not specify a value for this DBUSER parameter, Info*Engine does not specify a username when connecting to the MOM, and an anonymous connection is attempted. This parameter is optional.
SERVICE
The name of the Info*Engine property set that is configured for connectivity to a specific JMS service. This allows you to configure more than one JMS service per Info*Engine Virtual Machine (VM). This parameter is optional.
DELETE
Specifies whether or not to remove the message from the queue once it is retrieved from the queue. The default for this parameter is TRUE, which deletes the object once it is retrieved from the queue. Use FALSE to disable. This parameter is optional.
GET_BOOLEAN
Retrieves a Java Boolean value from the JMS message. The value can be specified as TRUE or FALSE. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_BYTE
Retrieves a single byte from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_BYTES
Retrieves multiple bytes from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_CHAR
Retrieves a single Java character from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_DOUBLE
Retrieves a Java double value from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_FLOAT
Retrieves a floating point number from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_INT
Retrieves an integer from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_LONG
Retrieves a long integer from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_SHORT
Retrieves a short integer from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
GET_STRING
Retrieves an instance of java.lang.String from the JMS message. This parameter can only be used if the incoming message type is StreamMessage. This parameter is optional.
PASSWD
The password to use when connecting to the MOM. If this parameter is specified, the parameter value takes precedence over existing credentials mapping for the authenticated user, or any value specified in the .msg.password and .jms.password properties of the service that is used to connect to the MOM. For more information, see Credentials Mapping for MOMs.
If this parameter is omitted, the mapped credentials for the Info*Engine messaging software are used. If no such mapping is found, then the mapped credentials for the Java Messaging Service (JMS) are used. If neither such mapped credentials are found, then the value set in the .msg.password property is used. If the .msg.password property is not set, then the value set in the .jms.password property is used. If neither property is set and you do not specify a value for this PASSWD parameter, Info*Engine does not specify a password when connecting to the MOM.
This parameter is optional.
QUEUE
The LDAP distinguished name of the JMS Queue from which to retrieve the message. The value is an LDAP distinguished name relative to a configured base URI. If relative, the cn= (common name attribute) is implicit if not explicitly specified. This parameter is required.
WHERE
Specifies a properly formatted JMS message selector, as defined in the Sun Java Message Service specification, used to select a subset of messages from the message queue for retrieval. The first message in the subset on the queue is returned. The default for this parameter is to select all messages in the queue. This parameter is optional.
EXAMPLE
The following example retrieves a message from the specified queue:
<%@page language="java" session="false"  %>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
                                               prefix="ie"%>

<ie:webject name="Query-Object" type="MSG">
  <ie:param name="DBUSER" data="$(@FORM[]dbuser[])"/>
  <ie:param name="PASSWD" data="$(@FORM[]passwd[])"/>
  <ie:param name="DELETE" data="$(@FORM[]delete[])"/>
  <ie:param name="QUEUE" data="$(@FORM[]queue[])"/>
  <ie:param name="WHERE" data="$(@FORM[]where[])"/>
</ie:webject>
To actually run this example you would need to provide a form where the dbuser, passwd, delete, and where variables are identified.