Advanced Customization > Business Logic Customization > Report Generation > Reporting Info*Engine Task Data Source Customization > Intended Outcome > Procedure – Creating an Info*Engine Task Data Source
  
Procedure – Creating an Info*Engine Task Data Source
1. Create an Info*Engine task XML file in <WindchillHome>/tasks/<MyTaskPackage>.
2. Write report task to return results in tabular format. This is an otherwise normal Info*Engine task that follows certain additional conventions. First, it returns a tabular Group where each column has objects of the same type. The following are the allowed column types:
java.lang.Boolean
java.lang.Long
java.lang.String
java.sql.Timestamp
java.util.Date
java.lang.Double
com.ptc.core.meta.common.FloatingPoint
com.ptc.core.meta.common.Hyperlink
java.math.BigDecimal
3. Add WBR Data Source parameter information to the task comments. There can be zero or more parameter comments. Each specified parameter must exist on a single line. The syntax for the parameter comment is as follows:
@param <type> <name> <description>
where <type> is the parameter Java type, <name> is the parameter name, and <description> describes the parameter. The following are the allowed parameter types:
java.lang.Boolean
java.lang.Long
java.lang.String
java.sql.Timestamp
java.util.Date
java.lang.Double
java.math.BigDecimal
4. Add WBR Data Source column information to the “return” task comment. The column information must be specified in the correct format for this task to be considered a Data Source. The syntax for the column comment is as follows:
@return <type> ${<variableName>} {columns: <columnList>}
where <type> is the Info*Engine task output type, <variableName> is a reference to the task variable that will be returned, and <columnList> describes the tabular format of the output. For more information on <type> and {<variableName>} consult section "SOAP Comments" in the Info*Engine User's Guide. The column is a comma separate list of one or more type and name pairs for each column in the tabular output. The type and name are separated by whitespace. The following are the allowed column types:
java.lang.Boolean
java.lang.Long
java.lang.String
java.sql.Timestamp
java.util.Date
java.lang.Double
com.ptc.core.meta.common.FloatingPoint
com.ptc.core.meta.common.Hyperlink
java.math.BigDecimal
5. Add task as a method to a ReportTask type. Create a file named “.delegateInfo” in the same directory as the task file. The file should contain the following two lines:
repositoryType=com.ptc.windchill

typeId=com.ptc.windchill.enterprise.report.ReportTask
6. Create and Install a package for <MyTask>. See “Advanced User Topics > Packages” in the Info*Engine User's Guide.
7. Update the Cognos model to recognize this new Data Source. Launch JConsole from installed Windchill shortcuts. Connect to the Embedded Servlet Engine (based on Tomcat) JVM instance. Select reporting management bean from the MBeans tab, “com.ptc > Monitors > ReportingSystem”. From the Operations tab, click “updateModel”.
8. Verify that the Data Source exists in Cognos. Login to Cognos using the <WBRHomeURL> and launch “Report Studio”. Find <MyTask> Data Source under “Windchill > Report Tasks > com.ptc.windchill.enterprise.report.ReportTask” in the “Insertable Objects” window under the “Source” tab.
The following is an example of task comments for a Data Source.
<!--com.infoengine.soap.rpc.def

Report Task Example.

@param java.lang.String param1 A string parameter named param1.

@param java.lang.Long param2 A numeric parameter named param2.

@return INFOENGINE_GROUP ${out} {columns: java.lang.String
name, com.ptc.core.meta.common.Hyperlink url, java.util.Date
deadline, java.math.BigDecimal duration}

-->