Dispatch-Tasks
DESCRIPTION
Selects a task that is capable of executing a specified action against objects of the specified type residing at the specified location. The webject facilitates the development of applications that operate upon information distributed across multiple hosts or comprised of multiple object types.
SYNTAX
<ie:webject name="Dispatch-Tasks" type="MGT">
<ie:param name="ACCESS" data="http|soap|internal"/>
<ie:param name="ACTION" data="action_name"/>
<ie:param name="CLIMBER" data="class_name"/>
<ie:param name="DEFAULT_DOMAIN" data="domain_name"/>
<ie:param name="DEFAULT_TYPE" data="type_name"/>
<ie:param name="GROUP_IN" data="group_name"/>
<ie:param name="GROUP_VDB" data="group_name"/>
<ie:param name="ID_ATTRIBUTE" data="attr_name"/>
<ie:param name="ID_META_ATTRIBUTE" data="meta_name"/>
<ie:param name="MAX_CONCURRENT" data="integer"/>
<ie:param name="PARAM" data="name=value"/>
<ie:param name="TASKS" data="group_name_or_url"/>
<ie:param name="TYPE_ATTRIBUTE" data="attr_name"/>
<ie:param name="TYPE_META_ATTRIBUTE" data="meta_name"/>
</ie:webject>
PARAMETERS
Required
|
Select
|
Optional
|
ACTION
|
ACCESS
|
CLIMBER
|
GROUP_IN
|
ID_ATTRIBUTE
|
GROUP_VDB
|
TASKS
|
ID_META_ATTRIBUTE
|
MAX_CONCURRENT
|
|
TYPE_ATTRIBUTE
|
PARAM
|
|
TYPE_META_ATTRIBUTE
|
|
ACCESS
Specifies the required access configuration of the task that is called as a result of this Dispatch-Tasks invocation. This parameter value is only consulted if the value of the ACTION parameter has been supplied from an external client. It behaves identically to the
access attribute on a task
page directive. The value can be a pipe-delimited list of access values. If no value is specified then the default task access of the system is used. For more information about the
access attribute, see
page Directive.
ACTION
Specifies the name of the logical action that is performed by the tasks that are selected and executed. ACTION is the primary selector used in choosing the tasks to be executed. This parameter is required.
CLIMBER
Identifies the name of a Java class which climbs data type hierarchies in search of task delegates. If specified, the parameter continues to be called by the webject until it either succeeds in finding the appropriate task delegate or reaches the top of the hierarchy. If the top of the hierarchy is reached without finding a task delegate, an exception is thrown. This parameter is optional.
DEFAULT_DOMAIN
Specifies a default domain to use instead of deriving the domain from the name of the local virtual machine in cases where objects don’t have attributes or metadata that identifies their domains.
DEFAULT_TYPE
Specifies a default type name to use instead of com.ptc.object in cases where objects don’t have attributes of metadata that identifies their types.
GROUP_IN
Specifies the name of the group containing the object upon which the logical action specified by ACTION is taken. Multiple values can be specified for this parameter, resulting in more than one group of objects upon which to apply the ACTION. This parameter is required.
GROUP_VDB
Provides the names of one or more groups that are provided to each of the called tasks in their VDBs. These names populate each of the called tasks’ VDBs with an initial set of groups other than the groups specified as GROUP_IN parameters.
ID_ATTRIBUTE
Specifies the name of the attribute that every element of the input group contains and that specifies each respective element’s unique object identifier. For example, if the value of this parameter is OBID, then it is assumed that every element of the input group contains an attribute named OBID, and that the value of each such attribute identifies the unique object identifier of the element containing it.
If specified, ID_ATTRIBUTE takes precedence over the ID_META_ATTRIBUTE. If neither ID_ATTRIBUTE nor ID_META_ATTRIBUTE is specified, an internal API is called to obtain the element’s unique object identifier. If an element is a Windchill type instance, then the API returns the Windchill type identifier of the object.
If either ID_ATTRIBUTE or ID_META_ATTRIBUTE is specified and fail to resolve an element’s unique object identifier an internal API is used to obtain the unique object identifier.
ID_META_ATTRIBUTE
Specifies the name of the metadata item that every element of the input group contains and that specifies each respective element’s unique object identifier. For example, if the value of this parameter is com.infoengine.obid, then it is assumed that every element of the input group contains a metadata item named com.infoengine.obid, and the value of each such attribute identifies the unique object identifier of the element associated with it.
If both ID_META_ATTRIBUTE and ID _ATTRIBUTE are specified, then ID_ATTRIBUTE takes precedence over the ID_META_ATTRIBUTE. If neither ID_ATTRIBUTE nor ID_META_ATTRIBUTE is specified, an internal API is called to obtain the element’s unique object identifier. If an element is a Windchill type instance, then the API returns the Windchill type identifier of the object.
If either ID_ATTRIBUTE or ID_META_ATTRIBUTE is specified and fails to resolve an element’s unique object identifier, an internal API is used to obtain the unique object identifier.
MAX_CONCURRENT
Specifies the maximum number of selected tasks that the webject is allowed to execute concurrently. If this parameter is not specified and multiple tasks are selected, they are executed sequentially. The default for this parameter is 1. This parameter is optional.
PARAM
Specifies additional parameters to be passed to the tasks that are selected and executed. Each value of this parameter is specified as a name=value pair, where name is the name of the additional parameter to be passed to each selected task, and value is the value of the parameter.
If PARAM is not specified, no additional parameters are passed to the selected task. Multiple values may be specified for this parameter. This parameter is optional.
TASKS
Specifies either an LDAP URL or the name of a group.
If an LDAP URL is specified, then the URL identifies a directory server and the node within the associated directory that establishes the root of a tree of task definitions. Tasks are selected from the tree on the basis of action name (from the ACTION parameter), object type (obtained per object based on TYPE_ATTRIBUTE or TYPE_META_ATTRIBUTE), and object location (obtained from the domain component of the object identifier of each object based on ID_ATTRIBUTE or ID_META_ATTRIBUTE).
If a group name is specified, then the group represents a table of task definitions. Each element of the group specifies one task definition, and each such definition is assumed to contain attributes named the following:
◦ ACTION – Specifies the logical name of the action supported by this definition. This attribute is compared to the ACTION parameter of the webject. If they do not match, then the definition does not apply to this invocation of the webject.
◦ TYPE – Specifies the object type to which this definition applies. This attribute is compared to the object type obtained from each element of the input group. If they do not match, then the definition does not apply to the element. If the value of this attribute is “*”, the definition applies to all object types.
◦ DOMAIN – Specifies the fully qualified domain name to which this definition applies. This attribute is compared to the domain component obtained from the unique object identifier of each element of the input group. If they do not match, then the definition does not apply to the element. If the value of this attribute is “*”, the definition applies to all domains.
◦ TASK – Specifies the URL of the Info*Engine task that implements the action associated with this definition.
◦ PROCESSOR – Specifies the name of the Info*Engine task processor that is capable of executing the task identified by the TASK attribute. If this attribute is not specified in a task definition, the task implementation identified by the TASK attribute can be accessed and executed anywhere.
This parameter is required.
TYPE_ATTRIBUTE
Specifies the name of the attribute that every element of the input group contains and that specifies each respective element’s object type. For example, if the value of this parameter is CLASS, then it is assumed that every element of the input group contains an attribute named CLASS, and the value of each such attribute identifies the object type of the element containing it.
If both TYPE_ATTRIBUTE and TYPE_META_ATTRIBUTE are specified, then TYPE_ATTRIBUTE takes precedence over the TYPE_META_ATTRIBUTE. If neither TYPE_ATTRIBUTE nor TYPE_META_ATTRIBUTE is specified, then an internal API is called to obtain the type identifier. If the element is a Windchill type instance, this API returns the Windchill type identifier of the object.
If either TYPE_ATTRIBUTE or TYPE_META_ATTRIBUTE is specified and fail to resolve an element’s type identifier an internal API is used to obtain the type identifier.
TYPE_META_ATTRIBUTE
Specifies the name of the metadata item that every element of the input group contains and that specifies each respective element’s object type. For example, if the value of this parameter is com.infoengine.objectType, then it is assumed that every element of the input group has an associated metadata item named com.infoengine.objectType, and the value of each such metadata object identifies the object type of the element associated with it.
If both TYPE_META_ATTRIBUTE and TYPE _ATTRIBUTE are specified, then TYPE _ATTRIBUTE takes precedence over TYPE_META_ATTRIBUTE. If neither TYPE_ATTRIBUTE nor TYPE_META_ATTRIBUTE is specified, then an internal API is called to obtain the type identifier. If the element is a Windchill type instance, this API returns the Windchill type identifier of the object.
If either TYPE_ATTRIBUTE or TYPE_META_ATTRIBUTE is specified and fail to resolve an element’s type identifier an internal API is used to obtain the type identifier.
EXAMPLE
<%@page language="java" session="true" errorPage="IEError.jsp" import="java.util.
Vector,java.util.Enumeration,com.infoengine.SAK.*" %>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie" %>
<html>
<head>
<title>Dispatch Tasks</title>
</head>
<body bgcolor="#FFFFFF">
<ie:getService varName="ie"/>
<ie:webject name="Create-Group" type="GRP">
<ie:param name="group_out" data="tasks"/>
<ie:param name="delimiter" data=":"/>
<ie:param name="element"
data="action=query:type=part:domain=s1.ptc.com:task=infoengine/
com/company/CreateGroup.xml"/>
<ie:param name="element"
data="action=query:type=part:domain=s2.ptc.com:task=infoengine/
com/company/CreateGroupA.xml"/>
<ie:param name="element"
data="action=query:type=part:domain=s3.ptc.com:task=infoengine/
com/company/JdbcQueryEmp.xml"/>
</ie:webject>
<ie:webject name="Create-Group" type="GRP">
<ie:param name="group_out" data="parts"/>
<ie:param name="delimiter" data=":"/>
<ie:param name="element" data="ufid=part1@s1.ptc.com:class=part:number=1"/>
<ie:param name="element" data="ufid=part2@s2.ptc.com:class=part:number=2"/>
<ie:param name="element" data="ufid=part3@s3.ptc.com:class=part:number=3"/>
<ie:param name="element" data="ufid=part4@s1.ptc.com:class=part:number=4"/>
<ie:param name="element" data="ufid=part5@s2.ptc.com:class=part:number=5"/>
<ie:param name="element" data="ufid=part6@s3.ptc.com:class=part:number=6"/>
<ie:param name="element" data="ufid=part7@s1.ptc.com:class=part:number=7"/>
<ie:param name="element" data="ufid=part8@s2.ptc.com:class=part:number=8"/>
<ie:param name="element" data="ufid=part9@s3.ptc.com:class=part:number=9"/>
</ie:webject>
<% long start = System.currentTimeMillis (); %>
<ie:webject name="Dispatch-Tasks" type="MGT">
<ie:param name="tasks" data="tasks"/>
<ie:param name="group_in" data="parts"/>
<ie:param name="max_concurrent" data="$(@FORM[]threads[])" default="10"/>
<ie:param name="action" data="$(@FORM[]action[])" default="query"/>
<ie:param name="type_attribute" data="class"/>
<ie:param name="id_attribute" data="ufid"/>
<ie:param name="param" data="group_out=results"/>
<ie:param name="param" data="jdbcAdapter=$(@FORM[]jdbcAdapter[])"
default="jdbcAdapter"/>
</ie:webject>
<% long duration = System.currentTimeMillis () - start; %>
<h2>Execution time: <%= duration %> msec</h2><br>
<ie:webject name="Display-Object" type="DSP">
<ie:param name="group_in" data="results"/>
<ie:param name="border" data="1"/>
<ie:param name="display_attribute_name" data="true"/>
</ie:webject>
</body>
</html>