Advanced Customization > Info*Engine User’s Guide > Task Webject Reference > Message Webjects > Query-Results
  
Query-Results
Retrieves a message from an Info*Engine task queue, returns the results, and by default, deletes the message from the queue. It is assumed that the message contains a known Info*Engine object, normally a group to return to a user.
* 
This webject can be used only after your environment has been set up for queuing tasks.
SYNTAX
<ie:webject name="Query-Results" type="MSG">
  <ie:param name="CORRELATION_ID" data="message_selector"/>
  <ie:param name="DBUSER" data="username"/>
  <ie:param name="DELETE" data="[TRUE | FALSE]"/>
  <ie:param name="PASSWD" data="password"/>
  <ie:param name="QUEUE" data="managed_queue_name"/>
  <ie:param name="WAIT_TIME" data="wait_time"/>
  <ie:param name="WHERE" data="message_selector"/>
</ie:webject>
PARAMETERS
Required
Select
Optional
CORRELATION_ID
DBUSER
SERVICE
DELETE
PASSWD
QUEUE
WAIT_TIME
WHERE
CORRELATION_ID
The JMS header correlation identifier. This value is used to select results from a response queue and corresponds to the CORRELATION_ID parameter used when queueing a task for execution with the Queue-Task webject. 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
Indicates whether or not the message is to be deleted from the queue when successfully returned to the user. If the value specified is TRUE, then the message is deleted. If the value specified is FALSE, then the message is not deleted. The default for this parameter is TRUE. 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.
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
An LDAP distinguished name of a managed queue. 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. The default for this parameter is to use the value specified in the com.infoengine.msg.defaultResultsQueue property.
This parameter is optional.
WAIT_TIME
The time in seconds to wait for the result to arrive in the specified queue. The default for this parameter is 0. This parameter is optional.
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 value of the CORRELATION_ID parameter from the Queue-Task webject can be used as the WHERE value to select the corresponding result.
The default value of this parameter is derived from the user identifier found in the SERVER context group and results in a subset that contains this user’s messages. This parameter is optional.
EXAMPLE
The following example retrieves a message from the specified queue and returns the results:
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
                                               prefix="ie"%>

<ie:webject name="Query-Results" type="MSG">
  <ie:param name="QUEUE" data="$(@FORM[]queue[0])"/>
  <ie:param name="CORRELATION_ID"
                                data="$(@FORM[]corrid[0])"/>
  <ie:param name="WHERE" data="$(@FORM[]where[0])"/>
  <ie:param name="DELETE" data="$(@FORM[]delete[])"/>
  <ie:param name="WAIT_TIME" data="10"/>
</ie:webject>

<ie:webject name="Return-Groups" type="GRP">
  <ie:param name="GROUP_IN" data="*"/>
</ie:webject>
To actually run this example you would need to provide a form where the queue, corrid, where, and delete variables are identified.