Authoring Info*Engine Tasks
|
When authoring an Info*Engine task it is very important to consider how you intend that task to be invoked. Info*Engine tasks might be executed in several different ways, including from other Java code using the SAK (for example, from a Windchill user interface or workflow), from a SOAP client, or from a raw HTTP client through the IE servlet. For example, if you are authoring a task that is intended to be called from a Windchill workflow you probably do not also intend for someone to be able to run that task through the IE servlet. To control how a task is executed, you can use the access attribute. For more information, see page Directive.
|
All webjects that do not directly deal with the display of information can be placed in Info*Engine tasks. That is, any webject with that has the DSP type exists only in a JSP page or custom application. The following standard webject types can be included in Info*Engine tasks and are known as “task webjects”:
• The GRP type, or group webjects.
• The OBJ type, or query webjects.
• The ACT type, or action webjects.
• The MGT type, or management webjects.
• The MSG type, or message webjects.
• The WES type, or Web Event Service webjects.
• The ADM type, or administrative webjects.
In addition, you can create external custom webjects (EXT) that provide custom solutions in either a JSP page or a standalone task. For more information, see
Creating an External Custom Webject.
Think of a task as a script of commands executed by Info*Engine. Each command in a task is a webject. The webjects are executed in the sequence defined within the task. By default, the sequence is from the top to the bottom. The webjects within a task perform operations such as querying databases, combining and integrating data in interesting ways, performing schema translations, and creating and updating database information. For a task to be successful, it must contain at least one properly constructed webject.
The following CreateGroup.xml task creates a group consisting of names, street addresses, and email addresses:
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<!-- Create an internal Group -->
<ie:webject name="Create-Group" type="GRP">
<ie:param name="ELEMENT"
data="NAME=Sam Johnson:ADDRESS=1234 Main St.:EMAIL=sjohnson@somewhere.com"/>
<ie:param name="ELEMENT"
data="NAME=Harvy Anderson:ADDRESS=1234 Amber St.:EMAIL=handerson@somewhere.com"/>
<ie:param name="ELEMENT"
data="NAME=James O'Connor:ADDRESS=775 Main St.:EMAIL="/>
<ie:param name="ELEMENT"
data="NAME=Harvey Hampton:ADDRESS=775 Main St.:EMAIL=hhampton@somewhere.com"/>
<ie:param name="CLASS" data="EmployeeData"/>
<ie:param name="GROUP_OUT" data="createdgroup"/>
</ie:webject>
The resulting “createdgroup” group generated by this task is shown as the following table:
NAME
|
ADDRESS
|
EMAIL
|
Sam Johnson
|
1234 Main St.
|
sjohnson@somewhere.com
|
Harvy Anderson
|
1234 Amber St.
|
handerson@somewhere.com
|
James O’Connor
|
775 Main St.
|
|
Harvey Hampton
|
775 Main St.
|
hhampton@somewhere.com
|
Notice that there was no EMAIL value specified for James O’Connor, so the corresponding table cell is empty.