118
global solutions innovation collaboration © 2001 PTC Rebecca French PTC Global Services Windchill Reporting R6.2 Draft A.2

Windchill Reporting R6.2

Embed Size (px)

DESCRIPTION

Windchill Reporting R6.2. Rebecca French PTC Global Services. Draft A.2. Contents. This workshop will cover the following areas Overview Examples and references Creating Reports Output Types Joins Sub Select IBA Reporting Workflow & Lifecycle History Reporting Non Standard Output - PowerPoint PPT Presentation

Citation preview

Page 1: Windchill Reporting R6.2

global solutions

innovation

collaboration

© 2001 PTC

Rebecca FrenchPTC Global Services

Rebecca FrenchPTC Global Services

Windchill ReportingR6.2

Windchill ReportingR6.2

Draft A.2Draft A.2

Page 2: Windchill Reporting R6.2

© 2001 PTC 2

ContentsContents

This workshop will cover the following areas Overview Examples and references Creating Reports

Output Types Joins Sub Select

IBA Reporting Workflow & Lifecycle History Reporting Non Standard Output

Charts Excel Web Query Xml Manipulation

Macros Configuration Advantages Limitations Objects & Relationships Summary

This workshop will cover the following areas Overview Examples and references Creating Reports

Output Types Joins Sub Select

IBA Reporting Workflow & Lifecycle History Reporting Non Standard Output

Charts Excel Web Query Xml Manipulation

Macros Configuration Advantages Limitations Objects & Relationships Summary

Page 3: Windchill Reporting R6.2

© 2001 PTC 3

Why Bother With Query Builder?Why Bother With Query Builder?

Query Builder provides an OOTB UI which enables consultants and customers to produce reports on the data held in Windchill in various formats quickly and easilyWhile it does require a good knowledge of Windchill as an application and some technical skill it is not rocket science and once you get used to it is no where near as daunting as first time users think.Things people say about Query Builder:

You need to know all about the data model NOT REALLY. You do need some awareness of the relationships

between objects and how they are constructed but this normally a fairly limited set. See Objects & Relationships Summary.

It is too difficult to understand NOT REALLY. It is not the easiest of tools to use at first sight, but given

a few pointers most people can get to grips with it. It is too limited

NOT REALLY. It will not necessarily fulfil every requirement the business has but you generally find it should satisfy 50-80% of the requirement, particularly at R6.x. With the addition of out puts such as Excel Web Query you can add another dimension to the report without customisation

Query Builder provides an OOTB UI which enables consultants and customers to produce reports on the data held in Windchill in various formats quickly and easilyWhile it does require a good knowledge of Windchill as an application and some technical skill it is not rocket science and once you get used to it is no where near as daunting as first time users think.Things people say about Query Builder:

You need to know all about the data model NOT REALLY. You do need some awareness of the relationships

between objects and how they are constructed but this normally a fairly limited set. See Objects & Relationships Summary.

It is too difficult to understand NOT REALLY. It is not the easiest of tools to use at first sight, but given

a few pointers most people can get to grips with it. It is too limited

NOT REALLY. It will not necessarily fulfil every requirement the business has but you generally find it should satisfy 50-80% of the requirement, particularly at R6.x. With the addition of out puts such as Excel Web Query you can add another dimension to the report without customisation

Page 4: Windchill Reporting R6.2

© 2001 PTC 4

What Query Builder Can Do OOTB

There are a large variety of OOTB outputs, Metrics can be calculated, Relationships can be navigated.Before you resort to customised reports – give it a try you may be surprised by how far you get!

There are a large variety of OOTB outputs, Metrics can be calculated, Relationships can be navigated.Before you resort to customised reports – give it a try you may be surprised by how far you get!

Page 5: Windchill Reporting R6.2

© 2001 PTC 5

What Query Builder Can Do OOTB

You can also output to other applications, via csv, tsv and xml.OOTB you can produce Excel Web Queries which add the functionality of Excel to the give greater flexibility on format, allowing automatic refresh from the database.

You can also output to other applications, via csv, tsv and xml.OOTB you can produce Excel Web Queries which add the functionality of Excel to the give greater flexibility on format, allowing automatic refresh from the database.

Page 6: Windchill Reporting R6.2

© 2001 PTC 6

OverviewOverview

Query Builder builds Report Template objects which are executed at runtimeQuery Builder builds Report Template objects which are executed at runtime

Input Parameters

CSS

BrowserPresentation

XSLTTransforms

CSV TSVHTML Custom OutputFormats

ReportTemplateGUI

Authoring

HTMLForm

Invocation Java Objects

Output

Oracle

JDBC

Execution

PersistenceManager

Report Template Object

XML Query Specification (QML)

XML

PotentialCustom Invocation

Low-Level OutputsFor Customizations

Output FormatCustomization

Points

Potential Custom QMLGeneration

Page 7: Windchill Reporting R6.2

© 2001 PTC 7

OverviewOverview

If you really find the OOTB functionality too limited you can see from the architecture that there are customisation points.

Don’t overlook the use of third party tools, such as Excel Web Query

Input sheets can be customised

Macros allow functions to be run to generate input

XSLT will allow manipulation of the output

The Charting element can be extended to provide more flexible charts and graphs

Extension of Query Builder has the advantage of still retaining the flexibility of a user interface to alter the input and output from reports

As we are all aware, business requirements are constantly shifting.

If you really find the OOTB functionality too limited you can see from the architecture that there are customisation points.

Don’t overlook the use of third party tools, such as Excel Web Query

Input sheets can be customised

Macros allow functions to be run to generate input

XSLT will allow manipulation of the output

The Charting element can be extended to provide more flexible charts and graphs

Extension of Query Builder has the advantage of still retaining the flexibility of a user interface to alter the input and output from reports

As we are all aware, business requirements are constantly shifting.

Page 8: Windchill Reporting R6.2

© 2001 PTC 8

OverviewOverview

This presentation will cover the use of the tool OOTB but there are references to where you can look for guidance on extending the functionality.

The presentation uses Windchill 6.2, the tool was much improved between versions 5 and 6. Some references have been made to the key differences between the versions but these are not comprehensive, so be warned, if you are using 5.x you may be disappointed, all the more reason to upgrade.

The use of the tool with other products such as Project Link and Dynamic Design Link has be investigated in a limited manner. At 6.1 you will be using a 5.1 Query Builder, at 6.2 it will be in line with Windchill 6.2. You may find that some of Class specific to the links are not available by default for selection. If you are to use Query builder with links in anger you may wish to clarify the support status.

This presentation will cover the use of the tool OOTB but there are references to where you can look for guidance on extending the functionality.

The presentation uses Windchill 6.2, the tool was much improved between versions 5 and 6. Some references have been made to the key differences between the versions but these are not comprehensive, so be warned, if you are using 5.x you may be disappointed, all the more reason to upgrade.

The use of the tool with other products such as Project Link and Dynamic Design Link has be investigated in a limited manner. At 6.1 you will be using a 5.1 Query Builder, at 6.2 it will be in line with Windchill 6.2. You may find that some of Class specific to the links are not available by default for selection. If you are to use Query builder with links in anger you may wish to clarify the support status.

Page 9: Windchill Reporting R6.2

© 2001 PTC 9

Examples and referencesExamples and references

All of the reports used in the presentation are supplied as examples, plus one or two extra. But there are other places you can look for information.

Windchill Report Templates

System/Reports

These are loaded via the Windchill load program, demo data. See Windchill Installation and Configuration Guide

Windchill Customizers Guide – Report Generation

Tutorial, accessible from Help in Query Builder

PTC Windmill

/Windchill Sample Reports

THIS IS PTC INTERNAL ONLY

All of the reports used in the presentation are supplied as examples, plus one or two extra. But there are other places you can look for information.

Windchill Report Templates

System/Reports

These are loaded via the Windchill load program, demo data. See Windchill Installation and Configuration Guide

Windchill Customizers Guide – Report Generation

Tutorial, accessible from Help in Query Builder

PTC Windmill

/Windchill Sample Reports

THIS IS PTC INTERNAL ONLY

Page 10: Windchill Reporting R6.2

© 2001 PTC 10

Creating a Report TemplateCreating a Report Template

Creating Reports Contents: Creating a basic Report on WTPart

Running the Report

Standard Output Types

Joins By Link Part Usage Parts and Described By Documents

Joins Via Criteria Change Activities

Sub-Select

Joins By Reference

Creating Reports Contents: Creating a basic Report on WTPart

Running the Report

Standard Output Types

Joins By Link Part Usage Parts and Described By Documents

Joins Via Criteria Change Activities

Sub-Select

Joins By Reference

Page 11: Windchill Reporting R6.2

© 2001 PTC 11

Creating a Report TemplateCreating a Report Template

This is done from Windchill Explorer

For example creating a report which will list the parts in the database, with optional search criteria fields

This is done from Windchill Explorer

For example creating a report which will list the parts in the database, with optional search criteria fields

Page 12: Windchill Reporting R6.2

© 2001 PTC 12

Creating a Report Template - FromCreating a Report Template - From

There are various tabs in which you can enter your information.

The first is From, this allows you to select the classes that will be used in the query, as input, output or to enable a join.

In this case we select WTPart

There are various tabs in which you can enter your information.

The first is From, this allows you to select the classes that will be used in the query, as input, output or to enable a join.

In this case we select WTPartOnly part of the class name should be entered. Some of the class on the list appear with spaces therefore entering an exact class name may not return the class you want on the list

Multiple classes may be selected at once, using the shift or control keys

Page 13: Windchill Reporting R6.2

© 2001 PTC 13

Creating a Report Template - SelectCreating a Report Template - Select

The Select tab allows you to select the attributes you want to display in the results of the reportThe Select tab allows you to select the attributes you want to display in the results of the report

Where there are multiple classes, you need to select the class which holds the attribute

Multiple attributes may be selected at once, using the shift or control keys

Page 14: Windchill Reporting R6.2

© 2001 PTC 14

Creating a Report Template - SelectCreating a Report Template - Select

In this case we want the Name, Number, Creator and Version Name and Number appear at the top level. The Creators Full Name appears as a sub option of Created By Version is a little more tricky. It will depend on the way you wish

it to be displayed.

Version -> Lineage -> Series -> Value

This will display the Revision.Iteration, e.g. A.5 The alias column contains the text which will be used as the

heading for the output in the results. It defaults to the modelled name which may not always be helpful to a user.

It can be updated by selecting the contents of the cell, and an alternate name can then be entered

In this case we want the Name, Number, Creator and Version Name and Number appear at the top level. The Creators Full Name appears as a sub option of Created By Version is a little more tricky. It will depend on the way you wish

it to be displayed.

Version -> Lineage -> Series -> Value

This will display the Revision.Iteration, e.g. A.5 The alias column contains the text which will be used as the

heading for the output in the results. It defaults to the modelled name which may not always be helpful to a user.

It can be updated by selecting the contents of the cell, and an alternate name can then be entered The order of the

selected attribute can be changed

Page 15: Windchill Reporting R6.2

© 2001 PTC 15

Creating a Report Template - AttributesCreating a Report Template - Attributes

Attributes can be one of two types: Persistent

These relate directly to a database or column (which may be a view rather than a table)

Derived These use Java Instance methods to establish values,

they are run after the query is run in the database. Key Differences

Derived attributes are most more costly on performance so should be used only when required

Derived attributes may not always be available for selection in functions, criteria or sorts (within query builder)

Derived attributes will detrimentally affect grouping

Attributes can be one of two types: Persistent

These relate directly to a database or column (which may be a view rather than a table)

Derived These use Java Instance methods to establish values,

they are run after the query is run in the database. Key Differences

Derived attributes are most more costly on performance so should be used only when required

Derived attributes may not always be available for selection in functions, criteria or sorts (within query builder)

Derived attributes will detrimentally affect grouping

Persistent Attribute

Derived Attribute

Page 16: Windchill Reporting R6.2

© 2001 PTC 16

Saving The ReportSaving The Report

Once there is enough information in the report that it could be run it can be saved.

As a minimum the report must have From classes and Selected attributes

The Report is saved in the users personal cabinet.

The Report may be moved to an alternate location once completed

Reports can have access control policies applied in the same way as other business objects

Once there is enough information in the report that it could be run it can be saved.

As a minimum the report must have From classes and Selected attributes

The Report is saved in the users personal cabinet.

The Report may be moved to an alternate location once completed

Reports can have access control policies applied in the same way as other business objects

Page 17: Windchill Reporting R6.2

© 2001 PTC 17

Creating a Report Template - CriteriaCreating a Report Template - Criteria

Criteria allows comparison between, attributes, parameters, constants and sub selects

Attribute – A persisted attribute on the class. Parameter – This represents user input. For each

Parameter Type an appropriate input field will be displayed at runtime

Constants – These allow enforcement of a fixed value, e.g Part State = Released

Sub Select – This allows a sub query to be entered as criteria, an example will be given

All of these options are used in the examples in this workshop

Criteria allows comparison between, attributes, parameters, constants and sub selects

Attribute – A persisted attribute on the class. Parameter – This represents user input. For each

Parameter Type an appropriate input field will be displayed at runtime

Constants – These allow enforcement of a fixed value, e.g Part State = Released

Sub Select – This allows a sub query to be entered as criteria, an example will be given

All of these options are used in the examples in this workshop

Page 18: Windchill Reporting R6.2

© 2001 PTC 18

Creating a Report Template - CriteriaCreating a Report Template - Criteria

In this case we want to allow the user to enter Name and State as criteria at runtime.In this case we want to allow the user to enter Name and State as criteria at runtime.

Select Name from the list of attributes for WTPart

Page 19: Windchill Reporting R6.2

© 2001 PTC 19

Creating a Report Template - CriteriaCreating a Report Template - Criteria

The information on the top half of the frame (Left Operand) will be compared, in the manner you select as the Operator, to the information in the lower half.In this case the attribute Name is compared to a value which will be entered by the user

The information on the top half of the frame (Left Operand) will be compared, in the manner you select as the Operator, to the information in the lower half.In this case the attribute Name is compared to a value which will be entered by the user

The Name for a parameter is the text which will appear as the title for the input field label

A default value may optionally be entered.

The operator is the comparison type, e.g. equals, greater than etc.

Page 20: Windchill Reporting R6.2

© 2001 PTC 20

Creating a Report Template - CriteriaCreating a Report Template - Criteria

The steps are repeated for StateThe steps are repeated for State

The default for an attribute which is an enumerated type will allow selection from a list

Page 21: Windchill Reporting R6.2

© 2001 PTC 21

Running the ReportRunning the Report

To run a fully formatted output with the required input parameters the you need to save the report.To run a fully formatted output with the required input parameters the you need to save the report.

The type of output can be selected

Criteria defined as Type Parameter can be entered.If an input field is left blank it will be ignored.

Page 22: Windchill Reporting R6.2

© 2001 PTC 22

Running the ReportRunning the Report

It is possible to test a report before saving using preview, this can be useful if you are unsure of the effect of changes you have made.

It is possible to test a report before saving using preview, this can be useful if you are unsure of the effect of changes you have made.

Page 23: Windchill Reporting R6.2

© 2001 PTC 23

OTTB Standard Output HTML – Standard HTML tabular output HTML with Sorting – Column headings can be used to sort output HTML with Merging – consecutive values in a column are merged CSV, TSV – Output to file, comma or tab separated MS Word 2000 HTML, see below (Not available 5.x) PDF, requires Adobe Acrobat Distiller (Not available 5.x) XML (Not available 5.x)

OTTB Standard Output HTML – Standard HTML tabular output HTML with Sorting – Column headings can be used to sort output HTML with Merging – consecutive values in a column are merged CSV, TSV – Output to file, comma or tab separated MS Word 2000 HTML, see below (Not available 5.x) PDF, requires Adobe Acrobat Distiller (Not available 5.x) XML (Not available 5.x)

Standard Output TypesStandard Output Types

HTML With Merging MSWord 2000 HTML

Page 24: Windchill Reporting R6.2

© 2001 PTC 24

The output type can be enforced for the query by setting the properties The output type can be enforced for the query by setting the properties

Enforcing OutputEnforcing Output

Page 25: Windchill Reporting R6.2

© 2001 PTC 25

Users can run reports from the HTML Interface Reports can be located via Local Search or Browse Cabinets Links to Generate the report appear beneath the URL for the

properties page or from the Properties Page. The Report description is shown on the properties page, this

helps users determine the applicability of the Report – so you should always enter this when the report is defined.

Users can run reports from the HTML Interface Reports can be located via Local Search or Browse Cabinets Links to Generate the report appear beneath the URL for the

properties page or from the Properties Page. The Report description is shown on the properties page, this

helps users determine the applicability of the Report – so you should always enter this when the report is defined.

Running Reports From HTML InterfaceRunning Reports From HTML Interface

Page 26: Windchill Reporting R6.2

© 2001 PTC 26

Currently the Report will only support the input of the correct Part name. To allow the input of wild cards (default wild card is %) the criteria should be altered to LIKE as opposed to =It is also case sensitive, to avoid this issue with any text input field it is advisable to set both Function settings to UPPER

Currently the Report will only support the input of the correct Part name. To allow the input of wild cards (default wild card is %) the criteria should be altered to LIKE as opposed to =It is also case sensitive, to avoid this issue with any text input field it is advisable to set both Function settings to UPPER

Refining CriteriaRefining Criteria

Page 27: Windchill Reporting R6.2

© 2001 PTC 27

The report outputs all iterations of all versions of the Parts. This is often an issue with iterated objects.To alleviate this an additional criteria is added which requires the attribute, Latest Iteration is a constant value of 1. This will show the latest iteration of all the revisions

The report outputs all iterations of all versions of the Parts. This is often an issue with iterated objects.To alleviate this an additional criteria is added which requires the attribute, Latest Iteration is a constant value of 1. This will show the latest iteration of all the revisions

Refining CriteriaRefining Criteria

Page 28: Windchill Reporting R6.2

© 2001 PTC 28

If the Report must return all parts where the name, and state are those entered, the iteration is the latest and the type is separable with a source of make, or the type is component with a source of buy.This could be written:

(Name = x) AND (State = y) AND (iteration = 1)

AND ( ( (type = separable) AND (source = make) ) OR

( (type = component) AND (source = buy) ) )In the Criteria tree it would be:

If the Report must return all parts where the name, and state are those entered, the iteration is the latest and the type is separable with a source of make, or the type is component with a source of buy.This could be written:

(Name = x) AND (State = y) AND (iteration = 1)

AND ( ( (type = separable) AND (source = make) ) OR

( (type = component) AND (source = buy) ) )In the Criteria tree it would be:

Refining Criteria - BooleansRefining Criteria - Booleans

If you need to move an entry you can drag it to the section you wish to move it to.NOT 5.x, in 5.x you must delete existing entry and recreate the entry in the new location

Page 29: Windchill Reporting R6.2

© 2001 PTC 29

This does not apply to R5.xIf the entire object is selected it will displayed in the form shown.

This does not apply to R5.xIf the entire object is selected it will displayed in the form shown.

Selecting Entire ObjectsSelecting Entire Objects

The Number (Name) Version string should be displayed as a link to the object’s properties.At 6.0 the link will be displayed, at R6.2 it is simply text, no link is generated. This issue has been logged as SPR#934820 and should be fixed in service pack 3.

The Number (Name) Version string should be displayed as a link to the object’s properties.At 6.0 the link will be displayed, at R6.2 it is simply text, no link is generated. This issue has been logged as SPR#934820 and should be fixed in service pack 3.

Page 30: Windchill Reporting R6.2

© 2001 PTC 30

In the case of most business objects you do not need to understand the data model as defined in Rose to use join.You need to understand Windchill and have some idea of the class names and you can create most of the links you need.For example the uses relationship for a Part. A Part Version owns all versions of another Part. All versions equates to the Part Master, therefore the link is from WTPart to WTPartMaster, the link is Part Usage.In the Rose model the relationship is represented:

In the case of most business objects you do not need to understand the data model as defined in Rose to use join.You need to understand Windchill and have some idea of the class names and you can create most of the links you need.For example the uses relationship for a Part. A Part Version owns all versions of another Part. All versions equates to the Part Master, therefore the link is from WTPart to WTPartMaster, the link is Part Usage.In the Rose model the relationship is represented:

Joins – Part UsesJoins – Part Uses

Page 31: Windchill Reporting R6.2

© 2001 PTC 31

On the From & Select Tabs:On the From & Select Tabs:

Joins – Part UsesJoins – Part Uses

Page 32: Windchill Reporting R6.2

© 2001 PTC 32

Link Vs Reference Link Joins are made where a modelled link with a cardinality

of greater than 1 exists, e.g a WTPart may reference more than one Document. The link name will be:

The name of the association class, if one is specified Else, link class name is the concatenation of role names If role names are not specified, they are derived from the end

class names Reference joins are made where the object to object

relationship has a cardinality or one or less E.g. A Part contains a reference to zero or one Teams A WfAssignedActivity must have a link to only one parent

process Some knowledge of Windchill and some areas of the data model is

required but an element of guess work will often suffice, see section Objects & Relationships summary at the end of the presentation

Link Vs Reference Link Joins are made where a modelled link with a cardinality

of greater than 1 exists, e.g a WTPart may reference more than one Document. The link name will be:

The name of the association class, if one is specified Else, link class name is the concatenation of role names If role names are not specified, they are derived from the end

class names Reference joins are made where the object to object

relationship has a cardinality or one or less E.g. A Part contains a reference to zero or one Teams A WfAssignedActivity must have a link to only one parent

process Some knowledge of Windchill and some areas of the data model is

required but an element of guess work will often suffice, see section Objects & Relationships summary at the end of the presentation

Joins – Part UsesJoins – Part Uses

Page 33: Windchill Reporting R6.2

© 2001 PTC 33

In the Join TabIn the Join Tab

Joins – Part UsesJoins – Part Uses

Output in merged HTMLOutput in merged HTML

Pick Part Usage

Page 34: Windchill Reporting R6.2

© 2001 PTC 34

If we want to add the link to Described by.This is a Part Version to Document Version link. WTPart to WTDocumentModelled as:

If we want to add the link to Described by.This is a Part Version to Document Version link. WTPart to WTDocumentModelled as:

Joins – Described By DocumentJoins – Described By Document

Page 35: Windchill Reporting R6.2

© 2001 PTC 35

If we want to add the link to Described by. This is a Part Version to Document Version link. WTPart to WTDocumentIf we want to add the link to Described by. This is a Part Version to Document Version link. WTPart to WTDocument

Joins – Described By DocumentJoins – Described By Document

Page 36: Windchill Reporting R6.2

© 2001 PTC 36

We want to create a report that shows the parent part, the uses parts and the documents that are associated to those “child” objects.For example:

We want to create a report that shows the parent part, the uses parts and the documents that are associated to those “child” objects.For example:

Joins – Uses + Described ByJoins – Uses + Described By

Page 37: Windchill Reporting R6.2

© 2001 PTC 37

To achieve this we can not simply combine the two previous reports.The Described By report navigates the WTPart to WTDocument relationship

To achieve this we can not simply combine the two previous reports.The Described By report navigates the WTPart to WTDocument relationship

Joins – Uses + Described ByJoins – Uses + Described By

WTPart WTDocument

WTPart

WTPartMaster

The uses navigates the WTPart to WTPartMasterThe uses navigates the WTPart to WTPartMaster

Therefore combining them would retrieve the Documents associated to the “parent” Wtpart, which does not meet the requirementTherefore combining them would retrieve the Documents associated to the “parent” Wtpart, which does not meet the requirement

WTPart

WTPartMaster

WTDocument

Page 38: Windchill Reporting R6.2

© 2001 PTC 38

We want to navigate to obtain the following relationshipsWe want to navigate to obtain the following relationships

Joins – Uses + Described ByJoins – Uses + Described By

So to achieve the desired result:So to achieve the desired result:

WTPart WTDocument

WTPart

WTPartMaster

WTPart

WTDocument

WTPartMaster

Page 39: Windchill Reporting R6.2

© 2001 PTC 39

Joins – Uses + Described ByJoins – Uses + Described By

To achieve this we need to be able to distinguish between two WTParts, to do this we add two WTPart classes to the From TabNOTE – when you are doing this alias the two parts sensibly so you know which one you are selecting for the joins or attributes and any criteria

To achieve this we need to be able to distinguish between two WTParts, to do this we add two WTPart classes to the From TabNOTE – when you are doing this alias the two parts sensibly so you know which one you are selecting for the joins or attributes and any criteria

Page 40: Windchill Reporting R6.2

© 2001 PTC 40

For the Join you need: Uses - Parent WTPart to WTPartMaster Master Iteration - WTPart Master to Child WTPart Described By - Child WTPart to WTDocument

For the Join you need: Uses - Parent WTPart to WTPartMaster Master Iteration - WTPart Master to Child WTPart Described By - Child WTPart to WTDocument

Joins – Uses + Described ByJoins – Uses + Described By

Part Usage Link

Master Iteration LinkWTPart Describe Link

WTPart - Child WTDocument

WTPart - Parent

WTPartMaster

WTPart - ChildWTDocument

WTPartMaster

Page 41: Windchill Reporting R6.2

© 2001 PTC 41

We add Select as required, making sure we pick the appropriate WTPartWe add Select as required, making sure we pick the appropriate WTPart

Joins – Uses + Described ByJoins – Uses + Described By

Page 42: Windchill Reporting R6.2

© 2001 PTC 42

A Change Activity has links to parts or documents that will be changed (Affected or Original Data Versions) and are the result of the change (Amended or New Data Versions)The Parts and Documents inherit from Changeable2, the Affected objects are linked by the AffectedActivityData link, Amended objects are linked by the ChangeRecord2 link.

A Change Activity has links to parts or documents that will be changed (Affected or Original Data Versions) and are the result of the change (Amended or New Data Versions)The Parts and Documents inherit from Changeable2, the Affected objects are linked by the AffectedActivityData link, Amended objects are linked by the ChangeRecord2 link.

Change Activity JoinChange Activity Join

Page 43: Windchill Reporting R6.2

© 2001 PTC 43

We want a report that will show the Change Activities and their associated amended or affected Documents. In Windchill we have:We want a report that will show the Change Activities and their associated amended or affected Documents. In Windchill we have:

Change Activity JoinChange Activity Join

Page 44: Windchill Reporting R6.2

© 2001 PTC 44

If we create the following report:If we create the following report:

Change Activity JoinChange Activity Join

This report will return zero results. No document version is going to be associated as both amended and affected. By definition a Document that is affected by a change will be altered, creating a new iteration or version, which is associated as the amended object

This report will return zero results. No document version is going to be associated as both amended and affected. By definition a Document that is affected by a change will be altered, creating a new iteration or version, which is associated as the amended object

Page 45: Windchill Reporting R6.2

© 2001 PTC 45

If we add two Documents, and alias appropriately then we can separate affected and amended links to the two document classes.If we add two Documents, and alias appropriately then we can separate affected and amended links to the two document classes.

Change Activity JoinChange Activity Join

Page 46: Windchill Reporting R6.2

© 2001 PTC 46

Change Activity JoinChange Activity Join

This shows results, but only where the Activity has both an affected and amended link, those with only affected are not shown.

This shows results, but only where the Activity has both an affected and amended link, those with only affected are not shown.

Therefore Change Activity 00001, Material Specification Change – 9978 is not shown in the results.The key requirement for the report is that we wish to see activities that have amended OR affected Documents.

Therefore Change Activity 00001, Material Specification Change – 9978 is not shown in the results.The key requirement for the report is that we wish to see activities that have amended OR affected Documents.

Page 47: Windchill Reporting R6.2

© 2001 PTC 47

To enforce the OR we can link the objects via the criteria tab.If we use the original report as a basis:

Removing the joins. The link classes need to be added as selected classes to

allow us to use them as criteria Selection remains unchanged.

To enforce the OR we can link the objects via the criteria tab.If we use the original report as a basis:

Removing the joins. The link classes need to be added as selected classes to

allow us to use them as criteria Selection remains unchanged.

Change Activity JoinChange Activity Join

Page 48: Windchill Reporting R6.2

© 2001 PTC 48

To successfully link the via criteria we need to look at the Rose model, and at the link properties in detailTo successfully link the via criteria we need to look at the Rose model, and at the link properties in detail

Change Activity JoinChange Activity Join

Link Properties

Page 49: Windchill Reporting R6.2

© 2001 PTC 49

Armed with the knowledge that Role A on the link is the Document, B is the Activity, the other element we need to understand is the attribute used on the link.Objects are normally linked using their unique persistence id. This is displayed on the object itself as Persist Info.Object Identifier.Id.

Armed with the knowledge that Role A on the link is the Document, B is the Activity, the other element we need to understand is the attribute used on the link.Objects are normally linked using their unique persistence id. This is displayed on the object itself as Persist Info.Object Identifier.Id.

Change Activity JoinChange Activity Join

x y ID Role A ID Link ID Role B ID ID a bPart or Doc Info Link Info Change Activity Info

So to display either the Change Activities where there is an affected or amended document the criteria would colloquially be:

( ( (Doc Id = Affected Role A ID) AND (Activity ID = Affected Role B ID) ) OR ( (Doc Id = Amended Role A ID)

AND (Activity ID = Amended Role B ID) ) )

So to display either the Change Activities where there is an affected or amended document the criteria would colloquially be:

( ( (Doc Id = Affected Role A ID) AND (Activity ID = Affected Role B ID) ) OR ( (Doc Id = Amended Role A ID)

AND (Activity ID = Amended Role B ID) ) )

Page 50: Windchill Reporting R6.2

© 2001 PTC 50

The expression:( ( (Doc Id = Affected Role A ID) AND (Activity ID = Affected Role B ID) ) OR ( (Doc Id = Amended Role A ID)

AND (Activity ID = Amended Role B ID) ) )

Would be implemented as shown below, in addition the results are limited to display only the latest iteration of any revision.

The expression:( ( (Doc Id = Affected Role A ID) AND (Activity ID = Affected Role B ID) ) OR ( (Doc Id = Amended Role A ID)

AND (Activity ID = Amended Role B ID) ) )

Would be implemented as shown below, in addition the results are limited to display only the latest iteration of any revision.

Change Activity JoinChange Activity Join

Page 51: Windchill Reporting R6.2

© 2001 PTC 51

If the report is run the results will be:If the report is run the results will be:

Change Activity JoinChange Activity Join

This includes a large number of duplicatesThis includes a large number of duplicates

Page 52: Windchill Reporting R6.2

© 2001 PTC 52

To reduce the duplicates the Distinct option on the select tab can be checkedThe results are then more coherent

To reduce the duplicates the Distinct option on the select tab can be checkedThe results are then more coherent

Change Activity JoinChange Activity Join

Page 53: Windchill Reporting R6.2

© 2001 PTC 53

This functionality is not available in 5.xA Sub-Select is a “query within a query,” a query statement nested within the main query designed to limit the selected output of the parent query by producing an intermediate result set of some sort.There are several different ways to include Sub-Selects the basic ones are:

Equality comparison operation IN NOT IN

It is important in any Sub-Select to ensure that there is only one field returned form the Sub-Select and that the object(s) returned from the Sub-Select are of the same type as the comparison.

This functionality is not available in 5.xA Sub-Select is a “query within a query,” a query statement nested within the main query designed to limit the selected output of the parent query by producing an intermediate result set of some sort.There are several different ways to include Sub-Selects the basic ones are:

Equality comparison operation IN NOT IN

It is important in any Sub-Select to ensure that there is only one field returned form the Sub-Select and that the object(s) returned from the Sub-Select are of the same type as the comparison.

Sub-SelectSub-Select

Page 54: Windchill Reporting R6.2

© 2001 PTC 54

For a Sub-Select equality operation only one result can be returned. Generally an equality Sub-Select can be more easily achieved as direct criteria.When using IN or NOT IN then the result from the Sub-Select may consist of more than one row. A match occurs if any of the rows matches. See example.Additionally you may use a Sub-Select using EXISTS or NOT EXISTS. This is not a comparison operation. It returns true or false.SQL knowledge is a definite help when using Sub-Selects.

For a Sub-Select equality operation only one result can be returned. Generally an equality Sub-Select can be more easily achieved as direct criteria.When using IN or NOT IN then the result from the Sub-Select may consist of more than one row. A match occurs if any of the rows matches. See example.Additionally you may use a Sub-Select using EXISTS or NOT EXISTS. This is not a comparison operation. It returns true or false.SQL knowledge is a definite help when using Sub-Selects.

Sub-SelectSub-Select

Page 55: Windchill Reporting R6.2

© 2001 PTC 55

If we look at the simple report on WTPartIf we look at the simple report on WTPart

Sub-Select - ExampleSub-Select - Example

The state is entered by the user at runtime.The state is entered by the user at runtime.

Page 56: Windchill Reporting R6.2

© 2001 PTC 56

If we wish enforce the return of objects at more than one state we could alter the criteria tabIf we wish enforce the return of objects at more than one state we could alter the criteria tab

Sub-Select - ExampleSub-Select - Example

To clarify the results if we add the Part’s State to the Select tab the results in this case would be:To clarify the results if we add the Part’s State to the Select tab the results in this case would be:

Page 57: Windchill Reporting R6.2

© 2001 PTC 57

We may want to expand this further, to include all of the parts art any of the states in the Review Lifecycle.We may want to expand this further, to include all of the parts art any of the states in the Review Lifecycle.

Sub-Select - ExampleSub-Select - Example

This would require four criteria within the OR of the criteria tab, this could become excessive if your Lifecycle contains a large number of states. An alternate method would be to add a Sub-Select in the criteria.

This would require four criteria within the OR of the criteria tab, this could become excessive if your Lifecycle contains a large number of states. An alternate method would be to add a Sub-Select in the criteria.

Page 58: Windchill Reporting R6.2

© 2001 PTC 58

Sub-Select - ExampleSub-Select - Example

If we remove the OR and then add a criteria comparing the WTPart State attribute to a value IN a Sub SelectIf we remove the OR and then add a criteria comparing the WTPart State attribute to a value IN a Sub Select

Selecting Edit Sub Select will allow the sub

query to be created

Page 59: Windchill Reporting R6.2

© 2001 PTC 59

Sub-Select - ExampleSub-Select - Example

Creating a Sub-Select uses the same techniques as creating a report, it contains the same tabs and methods.NOTE You may only select one value, which is compared to the value of the attribute in the object.In this case the Sub-Select needs to return state values where the state exists on a given Lifecycle Template name.A Lifecycle Template does not contain the states directly. The state is held in a Phase Template

Creating a Sub-Select uses the same techniques as creating a report, it contains the same tabs and methods.NOTE You may only select one value, which is compared to the value of the attribute in the object.In this case the Sub-Select needs to return state values where the state exists on a given Lifecycle Template name.A Lifecycle Template does not contain the states directly. The state is held in a Phase Template

Page 60: Windchill Reporting R6.2

© 2001 PTC 60

Sub-Select - ExampleSub-Select - Example

The the Sub-Select query would be constructed with the From tab and Join as shown here:The the Sub-Select query would be constructed with the From tab and Join as shown here:

Page 61: Windchill Reporting R6.2

© 2001 PTC 61

Sub-Select - ExampleSub-Select - Example

In the Select tab we can only select on value, in this case we use the Phase StateIn the Select tab we can only select on value, in this case we use the Phase State

Once the Sub-Select query has been Completed, Select OK on the Sub-Select window and then Save the Report Template.

You MUST Save the template before you re-enter the Sub Select or it will be re-initialised to the blank form !!!!!!

Once the Sub-Select query has been Completed, Select OK on the Sub-Select window and then Save the Report Template.

You MUST Save the template before you re-enter the Sub Select or it will be re-initialised to the blank form !!!!!!

Page 62: Windchill Reporting R6.2

© 2001 PTC 62

Sub-Select - ExampleSub-Select - Example

In this case the results from this report would be:In this case the results from this report would be:

Page 63: Windchill Reporting R6.2

© 2001 PTC 63

Join By ReferenceJoin By Reference

Note that this query will return any objects which are at a state in the Lifecycle Template, this may include objects on other Lifecycle Templates.To additionally enforce the selection of objects from a specific Lifecycle Template the Report would need to be updated.•The Lifecycle Template is added as a Class in the From Tab•A criteria Lifecycle Template name equals a constant of the

required name is added to the Criteria Tab

Note that this query will return any objects which are at a state in the Lifecycle Template, this may include objects on other Lifecycle Templates.To additionally enforce the selection of objects from a specific Lifecycle Template the Report would need to be updated.•The Lifecycle Template is added as a Class in the From Tab•A criteria Lifecycle Template name equals a constant of the

required name is added to the Criteria Tab

Page 64: Windchill Reporting R6.2

© 2001 PTC 64

Join By ReferenceJoin By Reference

Additionally the WTPart needs to be joined to the Lifecycle Template.A Lifecycle Template is not linked to a WTPart via a link class, it is linked via a WTReference.However, the distinction is not important when you create the join, The Query Builder tool will determine the type of join for you

Additionally the WTPart needs to be joined to the Lifecycle Template.A Lifecycle Template is not linked to a WTPart via a link class, it is linked via a WTReference.However, the distinction is not important when you create the join, The Query Builder tool will determine the type of join for you

Even if the join is created from the By Link section, if the Join you select is a Reference then the tool will place it in the By Reference section

Even if the join is created from the By Link section, if the Join you select is a Reference then the tool will place it in the By Reference section

Page 65: Windchill Reporting R6.2

© 2001 PTC 65

When constructing an IBA report is important to remember that IBAs, while they may be seen as just more attributes on an part, are objects in themselves that are related to the part.When constructing a report the fowling relations must be considered:

A part is an IBA holder, it contains references to the IBA types

When creating a report you must know which type of IBA you are linking to. E.g. String, Float etc.

An IBA has a definition of its type and and value which it holds

See the following example for guidance on how to create the relationships between a WTPart and and IBA.

When constructing an IBA report is important to remember that IBAs, while they may be seen as just more attributes on an part, are objects in themselves that are related to the part.When constructing a report the fowling relations must be considered:

A part is an IBA holder, it contains references to the IBA types

When creating a report you must know which type of IBA you are linking to. E.g. String, Float etc.

An IBA has a definition of its type and and value which it holds

See the following example for guidance on how to create the relationships between a WTPart and and IBA.

IBA ReportingIBA Reporting

Page 66: Windchill Reporting R6.2

© 2001 PTC 66

We have parts in the database which are provided by a supplier, these have IBAs associated to them.

LeadTime - which is an integer value representing the number of days between order and delivery

Cost - A float value representing the cost in pounds

We want to create two reports: A report which shows the parts which have a lead time of

less than 20 days A report which shows the parts which have a cost of less

than £80

We have parts in the database which are provided by a supplier, these have IBAs associated to them.

LeadTime - which is an integer value representing the number of days between order and delivery

Cost - A float value representing the cost in pounds

We want to create two reports: A report which shows the parts which have a lead time of

less than 20 days A report which shows the parts which have a cost of less

than £80

IBA ReportingIBA Reporting

Page 67: Windchill Reporting R6.2

© 2001 PTC 67

The classes which must be selected are: The WTPart The IBA type Definition, which contains the name of the

IBA, for the lead time this will be IntegerDefinition The IBA type Value, which contains the value, for the lead

time this will be IntegerValue

The classes which must be selected are: The WTPart The IBA type Definition, which contains the name of the

IBA, for the lead time this will be IntegerDefinition The IBA type Value, which contains the value, for the lead

time this will be IntegerValue

IBA ReportingIBA Reporting

Page 68: Windchill Reporting R6.2

© 2001 PTC 68

Select & CriteriaSelect & Criteria

IBA ReportingIBA Reporting

The Joins required as as follows:The Joins required as as follows:

Output:Output:

Page 69: Windchill Reporting R6.2

© 2001 PTC 69

IBA ReportingIBA Reporting

To query for objects with a cost less than 80 the Report would be as follows:To query for objects with a cost less than 80 the Report would be as follows:

Page 70: Windchill Reporting R6.2

© 2001 PTC 70

IBA ReportingIBA Reporting

To query for objects with a cost less than 80 and that have a lead time of less than 20 the Report would be as follows:To query for objects with a cost less than 80 and that have a lead time of less than 20 the Report would be as follows:

This report will only return Parts which have both the IBAs Cost and LeadTime

This report will only return Parts which have both the IBAs Cost and LeadTime

Page 71: Windchill Reporting R6.2

© 2001 PTC 71

Workflow and Lifecycle History reporting is normally carried out to monitor or gather metricsThis section covers:

Workflow Objects Relationships Key Objects and Joins Workflow Report Examples Lifecycle History Overview Lifecycle History Modelled Relationships Lifecycle History Example

There are further examples in the section on Chart Output and Excel Web Query

Workflow and Lifecycle History reporting is normally carried out to monitor or gather metricsThis section covers:

Workflow Objects Relationships Key Objects and Joins Workflow Report Examples Lifecycle History Overview Lifecycle History Modelled Relationships Lifecycle History Example

There are further examples in the section on Chart Output and Excel Web Query

Workflow and Lifecycle ReportsWorkflow and Lifecycle Reports

Page 72: Windchill Reporting R6.2

© 2001 PTC 72

When reporting on Workflows it is important to understand the relationships.The key classes are WfAssignedActivity and WorkItem

When reporting on Workflows it is important to understand the relationships.The key classes are WfAssignedActivity and WorkItem

Workflow Modeled RelationshipsWorkflow Modeled Relationships

The WfAssignedActivity is linked by reference to the WfProcess instance via an attribute inherited from WfNode, parentProcessRef

The WorkItem is linked to the Primary Business Object via an attribute, primaryBusinessObject

The WfAssignedActivity is linked by reference to the WfProcess instance via an attribute inherited from WfNode, parentProcessRef

The WorkItem is linked to the Primary Business Object via an attribute, primaryBusinessObject

Page 73: Windchill Reporting R6.2

© 2001 PTC 73

When an instance of WfProcess runs an Activity is instantiated as WfAssignedActivity

The WfAssignedActivity may be assigned to one or more users, this is done via a WfAssignment and results in the user being allocated a WorkItem

When an instance of WfProcess runs an Activity is instantiated as WfAssignedActivity

The WfAssignedActivity may be assigned to one or more users, this is done via a WfAssignment and results in the user being allocated a WorkItem

Workflow RelationshipsWorkflow Relationships

WfProcess

WfActivity WfActivity

WorkItem WorkItem WorkItem

Activities, e.g. Set Users, Review, Approve

Objects which appear on the users worklist

Assignment is made via the WfAssigment class

Page 74: Windchill Reporting R6.2

© 2001 PTC 74

Reporting on Activities If you are try to monitor task information by user then you need

to query the Work Item. If you are trying to monitor how long a task took in total, rather

than by user, then you need to query the WfAssignedActivity. Note that where an activity is in a loop, only the last visit will be

returned in any query.

Joins A WorkItem joins to a WfAssignment via a WorkItemLink A WfAssignment joins to a WfAssignedActivity via a

ActivityAssignmentLink A WfAssignedActivity joins to a WfProcess via a

ParentProcessReference The Primary Business Object can be joined to the WorkItem via a

PrimaryBusinessObject reference

Reporting on Activities If you are try to monitor task information by user then you need

to query the Work Item. If you are trying to monitor how long a task took in total, rather

than by user, then you need to query the WfAssignedActivity. Note that where an activity is in a loop, only the last visit will be

returned in any query.

Joins A WorkItem joins to a WfAssignment via a WorkItemLink A WfAssignment joins to a WfAssignedActivity via a

ActivityAssignmentLink A WfAssignedActivity joins to a WfProcess via a

ParentProcessReference The Primary Business Object can be joined to the WorkItem via a

PrimaryBusinessObject reference

Workflow Key Objects and JoinsWorkflow Key Objects and Joins

Page 75: Windchill Reporting R6.2

© 2001 PTC 75

Report:

Get the duration of each completed WorkItem, displaying the task name, user and role.

Classes need are the WorkflowAssignedActivity to get the name of the task, the WorkItem for the user, role and duration.

These need to be linked via the Workflow Assignment class

Report:

Get the duration of each completed WorkItem, displaying the task name, user and role.

Classes need are the WorkflowAssignedActivity to get the name of the task, the WorkItem for the user, role and duration.

These need to be linked via the Workflow Assignment class

Workflow Example – WorkItem DurationWorkflow Example – WorkItem Duration

Page 76: Windchill Reporting R6.2

© 2001 PTC 76

The name is selected from the WfAssignedActivity, the Role and user (owner) from the WorkItem.The duration is not an attribute, it is the result of a subtraction of the creation date from the last updated date, where the WorkItem is complete.

The name is selected from the WfAssignedActivity, the Role and user (owner) from the WorkItem.The duration is not an attribute, it is the result of a subtraction of the creation date from the last updated date, where the WorkItem is complete.

Check the Advanced option to allow function to be performed between attributes

In this case we are performing a function on a date therefore we can either use Subtract to get the number of days or Time Difference(Days)

Workflow Example – WorkItem DurationWorkflow Example – WorkItem Duration

Page 77: Windchill Reporting R6.2

© 2001 PTC 77

Remaining definitionsRemaining definitions

Floor is applied to the Duration to round the result down

Only Completed WorkItems are returned

Workflow Example – WorkItem DurationWorkflow Example – WorkItem Duration

Page 78: Windchill Reporting R6.2

© 2001 PTC 78

Results:Results:

Workflow Example – WorkItem DurationWorkflow Example – WorkItem Duration

Page 79: Windchill Reporting R6.2

© 2001 PTC 79

Report

Duration of each activity for a specific Document, which has completed its process

In this case we would appear only to need the WTDocument, WfProcess and the WfAssignedActivity. However, to link to the PrimaryBusinessObject we need to include the WorkItem.As before we need the WfAssignment class to link the WfAssignedActivity to the WorkItem

Report

Duration of each activity for a specific Document, which has completed its process

In this case we would appear only to need the WTDocument, WfProcess and the WfAssignedActivity. However, to link to the PrimaryBusinessObject we need to include the WorkItem.As before we need the WfAssignment class to link the WfAssignedActivity to the WorkItem

Workflow Example – Duration By ObjectWorkflow Example – Duration By Object

Page 80: Windchill Reporting R6.2

© 2001 PTC 80

JoinJoin

Workflow Example – Duration By ObjectWorkflow Example – Duration By Object

Page 81: Windchill Reporting R6.2

© 2001 PTC 81

Select and CriteriaSelect and Criteria

Workflow Example – Duration By ObjectWorkflow Example – Duration By Object

Appears as Executed on the list of possible States

NOTE this functionality is not available in 5.xNOTE this functionality is not available in 5.x

Page 82: Windchill Reporting R6.2

© 2001 PTC 82

If the report is run, entering 77265-4 as the Document number, results would be of the form:If the report is run, entering 77265-4 as the Document number, results would be of the form:

Workflow Example – Duration By ObjectWorkflow Example – Duration By Object

Page 83: Windchill Reporting R6.2

© 2001 PTC 83

The Workflow examples provided OOTB are: Overdue Processes Overdue Running Processes Overdue Work Category Team Processes Processes Initiated by Current User

These can be loaded via the Load Demo and Load Report utilities

The Workflow examples provided OOTB are: Overdue Processes Overdue Running Processes Overdue Work Category Team Processes Processes Initiated by Current User

These can be loaded via the Load Demo and Load Report utilities

OOTB Workflow Reports ExamplesOOTB Workflow Reports Examples

Page 84: Windchill Reporting R6.2

© 2001 PTC 84

Information on how an Object progress through a lifecycle is held in the Lifecycle History. The entire history for an object can be displayed by accessing the Lifecycle History link on the Properties page for the object.

Information on how an Object progress through a lifecycle is held in the Lifecycle History. The entire history for an object can be displayed by accessing the Lifecycle History link on the Properties page for the object.

Lifecycle History OverviewLifecycle History Overview

The History lists the actions, E.g. Set State, Promote. It also lists an Action of Enter_Phase. The object will always have an action Enter_Phase whether the state change occurred due to a Set State robot, Promote robot or any other action.This is key if you are interested in reports on the dates of state change.

The history also contains information on reviews

The user listed against automatic actions such as enter phase or set state will always appear as actioned by Administrator

Page 85: Windchill Reporting R6.2

© 2001 PTC 85

The History is modelled as shown.

Generally it is not necessary to retrieve information on signatures, if users need all of the information, including signatures they can access the Lifecycle History link, recreating this as a report is simply a duplication of OOTB functionality

The History is modelled as shown.

Generally it is not necessary to retrieve information on signatures, if users need all of the information, including signatures they can access the Lifecycle History link, recreating this as a report is simply a duplication of OOTB functionality

Lifecycle History ModelLifecycle History Model

Page 86: Windchill Reporting R6.2

© 2001 PTC 86

Report:Report on the time taken from creation of the Document to the time each State was entered where the Document is currently in a Released State

Allow user input of Document Name non cases sensitive strings with wild cards

List the name, number and version of the Document, the state, duration and the date the state was entered The Select and Join tabs of the report would be as follows:

Report:Report on the time taken from creation of the Document to the time each State was entered where the Document is currently in a Released State

Allow user input of Document Name non cases sensitive strings with wild cards

List the name, number and version of the Document, the state, duration and the date the state was entered The Select and Join tabs of the report would be as follows:

Lifecycle History ExampleLifecycle History Example

Page 87: Windchill Reporting R6.2

© 2001 PTC 87

Select:Select:

Lifecycle History ExampleLifecycle History Example

Note that the state must be selected from the Lifecycle History, NOT the Document

Note that the state must be selected from the Lifecycle History, NOT the Document

Page 88: Windchill Reporting R6.2

© 2001 PTC 88

Criteria:Criteria:

Lifecycle History ExampleLifecycle History Example

Sort on the following.Note that the sort will be a strict alphanumeric sort therefore values above 100 will distort the sort, also sorts on dates will not sort by the date as you would expect

Sort on the following.Note that the sort will be a strict alphanumeric sort therefore values above 100 will distort the sort, also sorts on dates will not sort by the date as you would expect

Page 89: Windchill Reporting R6.2

© 2001 PTC 89

The output in merged HTML would be of the following formThe output in merged HTML would be of the following form

Lifecycle History ExampleLifecycle History Example

Page 90: Windchill Reporting R6.2

© 2001 PTC 90

It should be noted that where each state is associated to a Phase Workflow state durations can be determined by the time each workflow takes to execute

It should be noted that where each state is associated to a Phase Workflow state durations can be determined by the time each workflow takes to execute

Workflow Vs. Lifecycle HistoryWorkflow Vs. Lifecycle History

Page 91: Windchill Reporting R6.2

© 2001 PTC 91

Non Standard OutputNon Standard Output

There are alternate outputs provided OOTB that do not appear on the standard list.

Chart Output Bar Chart (barChart.xsl) Line Chart (lineChart.xsl) Pie Chart (pieChart.xsl)

Excel Web Query Excel 2000 format (excel2000WebQuery.xsl) Excel 97 format (excel97WebQuery.xsl)

It is also possible to create your own XSLT style sheets to generate other output types, see Windchill Customizers Guide – Report Generation

There are alternate outputs provided OOTB that do not appear on the standard list.

Chart Output Bar Chart (barChart.xsl) Line Chart (lineChart.xsl) Pie Chart (pieChart.xsl)

Excel Web Query Excel 2000 format (excel2000WebQuery.xsl) Excel 97 format (excel97WebQuery.xsl)

It is also possible to create your own XSLT style sheets to generate other output types, see Windchill Customizers Guide – Report Generation

Page 92: Windchill Reporting R6.2

© 2001 PTC 92

Non Standard OutputNon Standard Output

Chart output was not available OOTB at 5.x but there is an example customisation in Windmill, in /Windchill Sample Reports.

Web Query was also not available in 5.x but the xsl files you need to easily implement it are in Windmill, in /Windchill Sample Reports.

Chart output was not available OOTB at 5.x but there is an example customisation in Windmill, in /Windchill Sample Reports.

Web Query was also not available in 5.x but the xsl files you need to easily implement it are in Windmill, in /Windchill Sample Reports.

Page 93: Windchill Reporting R6.2

© 2001 PTC 93

If we want to create a bar chart showing the average duration in days that tasks take from creation to completion by all required usersUsing the example in the first workflow query as a basis.

If we want to create a bar chart showing the average duration in days that tasks take from creation to completion by all required usersUsing the example in the first workflow query as a basis.

Output – Bar ChartOutput – Bar Chart

Page 94: Windchill Reporting R6.2

© 2001 PTC 94

The Select options are adjusted.Function Average is added to the subtraction of WorkItem Created Date from the Last Updated DateIf an aggregate function, e.g. Max, Min, Average, Count etc, is used the output must be grouped, this is achieved by checking the Group By option

The Select options are adjusted.Function Average is added to the subtraction of WorkItem Created Date from the Last Updated DateIf an aggregate function, e.g. Max, Min, Average, Count etc, is used the output must be grouped, this is achieved by checking the Group By option

Output – Bar ChartOutput – Bar Chart

Page 95: Windchill Reporting R6.2

© 2001 PTC 95

Chart generation is only accessible by entering a custom XSL URLChart generation is only accessible by entering a custom XSL URL

Output - ChartsOutput - Charts

Page 96: Windchill Reporting R6.2

© 2001 PTC 96

In order to implement a custom chart type: Implement the wt.query.template.Chartable interface

Inputs: Report data, chart width and height, parameter string Outputs: Java Component which produces chart

Add any necessary classes to the method server classpath (e.g. to the Windchill codebase)

Create a custom XSLT stylesheet using existing chart XSLT as a template

Change Chartable implementation class name Change parameter string as necessary Change chart width and height as desired

In order to implement a custom chart type: Implement the wt.query.template.Chartable interface

Inputs: Report data, chart width and height, parameter string Outputs: Java Component which produces chart

Add any necessary classes to the method server classpath (e.g. to the Windchill codebase)

Create a custom XSLT stylesheet using existing chart XSLT as a template

Change Chartable implementation class name Change parameter string as necessary Change chart width and height as desired

Output – Custom Chart TypesOutput – Custom Chart Types

Page 97: Windchill Reporting R6.2

© 2001 PTC 97

Excel 97 and 2000 both support the retrieval of data from external sources, this includes retrieval of data from Windchill using a iqy file generated from a query.The Report output does not by default appear on the list, it must be entered as a Custom XSL URL in the same manner as for Chart Output.

For Excel 97 - templates/reports/excel97WebQuery.xsl For Excel 2000 - templates/reports/excel2000WebQuery.xsl

The following slides explain the steps required to create, use and update a report in Excel using a Web Query generated from a Report

Excel 97 and 2000 both support the retrieval of data from external sources, this includes retrieval of data from Windchill using a iqy file generated from a query.The Report output does not by default appear on the list, it must be entered as a Custom XSL URL in the same manner as for Chart Output.

For Excel 97 - templates/reports/excel97WebQuery.xsl For Excel 2000 - templates/reports/excel2000WebQuery.xsl

The following slides explain the steps required to create, use and update a report in Excel using a Web Query generated from a Report

Output – Excel Web QueryOutput – Excel Web Query

Page 98: Windchill Reporting R6.2

© 2001 PTC 98

Using a lifecycle history report:Using a lifecycle history report:

Output – Excel Web QueryOutput – Excel Web Query

Page 99: Windchill Reporting R6.2

© 2001 PTC 99

The Report is generated and the XSL URL enteredThe Report is generated and the XSL URL entered

Output – Excel Web QueryOutput – Excel Web Query

This will prompt for Open or Save To Disk – DO NOT OPEN – it will not make any sense!Save to Disk – Make sure you enter IQY for the extension of the file

This will prompt for Open or Save To Disk – DO NOT OPEN – it will not make any sense!Save to Disk – Make sure you enter IQY for the extension of the file

Page 100: Windchill Reporting R6.2

© 2001 PTC 100

From Excel create a new WorkbookSelect an appropriate cell, e.g. A1

From Excel create a new WorkbookSelect an appropriate cell, e.g. A1

Output – Excel Web QueryOutput – Excel Web Query

Navigate to where the IQY file was saved

Confirm the input location Log in to Windchill to run the report

Page 101: Windchill Reporting R6.2

© 2001 PTC 101

Once the report has been run it will appear in the following form:Once the report has been run it will appear in the following form:

Output – Excel Web QueryOutput – Excel Web Query

Page 102: Windchill Reporting R6.2

© 2001 PTC 102

The spreadsheet can be modified. More than one query can be added to a spread sheet to allow calculations, pivot tables and charts to be created using data from multiple queries

The spreadsheet can be modified. More than one query can be added to a spread sheet to allow calculations, pivot tables and charts to be created using data from multiple queries

Output – Excel Web QueryOutput – Excel Web Query

Charts can be added in any format

Pivot tables can be added

Calculations can be added, =IF(AND(B11=B12,C11=C12),E12-E11,0), these can be automatically updated on refresh of data

Page 103: Windchill Reporting R6.2

© 2001 PTC 103

Refreshing Data When data is refreshed it will, in some cases, undo the

formatting etc., therefore it is recommended that formating etc. is performed using macros.

To refresh the data select a cell in the report range Data -> Refresh Data

Refreshing Data When data is refreshed it will, in some cases, undo the

formatting etc., therefore it is recommended that formating etc. is performed using macros.

To refresh the data select a cell in the report range Data -> Refresh Data

Output – Excel Web QueryOutput – Excel Web Query

Page 104: Windchill Reporting R6.2

© 2001 PTC 104

It is quite common for different areas of the business to have different requirements, which would require different customisations

The business requirement can change frequently requiring output formats to be updated on a regular basis

Using an Excel Web query with macro formatting and calculations allows:

The business to format the reports in any manner they wish

Various formats of chart to be added to the spread sheet without custom formats being developed

Calculations and other functions such as pivot tables to be quickly and easily generated

There is an example formatted Web Query with this presentation. It contains a Macro as example of how, relatively easily the query can be refreshed and reformated

It is quite common for different areas of the business to have different requirements, which would require different customisations

The business requirement can change frequently requiring output formats to be updated on a regular basis

Using an Excel Web query with macro formatting and calculations allows:

The business to format the reports in any manner they wish

Various formats of chart to be added to the spread sheet without custom formats being developed

Calculations and other functions such as pivot tables to be quickly and easily generated

There is an example formatted Web Query with this presentation. It contains a Macro as example of how, relatively easily the query can be refreshed and reformated

Excel Web Query AdvantagesExcel Web Query Advantages

Page 105: Windchill Reporting R6.2

© 2001 PTC 105

Macros are provided to enable parameter and constant values to be derived by the system at report execution time.

Two are provided with OOTB

CURRENT_USER_NAME

CURRENT_TIME

Macros can be created by extending the extending the MacroExpressionProcessor see Windchill Customizers Guide – Report Generation

There are also a few examples in Windmill /Windchill Sample Reports

Macros are provided to enable parameter and constant values to be derived by the system at report execution time.

Two are provided with OOTB

CURRENT_USER_NAME

CURRENT_TIME

Macros can be created by extending the extending the MacroExpressionProcessor see Windchill Customizers Guide – Report Generation

There are also a few examples in Windmill /Windchill Sample Reports

MacrosMacros

Page 106: Windchill Reporting R6.2

© 2001 PTC 106

Various aspects of Reporting can be configured or actioned from the server:

Standard Output Type list can be modified or added to Import/Export of Templates is possible from the command

line The wild card, default %, can be altered The number of returns from a query can be limited to avoid

negative database impact if excessively large queries are run

Various aspects of Reporting can be configured or actioned from the server:

Standard Output Type list can be modified or added to Import/Export of Templates is possible from the command

line The wild card, default %, can be altered The number of returns from a query can be limited to avoid

negative database impact if excessively large queries are run

ConfigurationConfiguration

Page 107: Windchill Reporting R6.2

© 2001 PTC 107

Adding an XSLT style sheet to the standard list The format must be added to a suitable properties file, it is

recommended that this is a custom properties file, the OOTB properties file is dbservice.properties

The entry must be in the following form:wt.services/rsc/default/wt.query.report.DefaultXSL/Format_Name/java.lang.Object/0=template_locationE.g.wt.services/rsc/default/wt.query.report.DefaultXSL/Excel2000WebQuery/java.lang.Object/0=templates.ext.mine.excel2000WebQueryThe location is relative to $WT_HOME/codebase, the extension of the file should not be enteredThe format name, location or template name may NOT contain spaces

The entry will then appear on the list as the Format Name, e.g. Excel2000WebQuery

If a localised version or alternate format of display is required then the resource bundle, wt.query.template.templateResource must be updated by modifying and rebuilding templateResource.rbInfo

Adding an XSLT style sheet to the standard list The format must be added to a suitable properties file, it is

recommended that this is a custom properties file, the OOTB properties file is dbservice.properties

The entry must be in the following form:wt.services/rsc/default/wt.query.report.DefaultXSL/Format_Name/java.lang.Object/0=template_locationE.g.wt.services/rsc/default/wt.query.report.DefaultXSL/Excel2000WebQuery/java.lang.Object/0=templates.ext.mine.excel2000WebQueryThe location is relative to $WT_HOME/codebase, the extension of the file should not be enteredThe format name, location or template name may NOT contain spaces

The entry will then appear on the list as the Format Name, e.g. Excel2000WebQuery

If a localised version or alternate format of display is required then the resource bundle, wt.query.template.templateResource must be updated by modifying and rebuilding templateResource.rbInfo

Configuration – Adding Output TypesConfiguration – Adding Output Types

Page 108: Windchill Reporting R6.2

© 2001 PTC 108

Export/Import of Templates Report templates can be exported using a command line utility

from the server, see Windchill Customizers Guide – Report Generation. This creates two files a csv load file and an XML representation of the report. The csv references the XML file(s).

Reports can be imported into another system using either, LoadReportTemplate or LoadFromFile both methods are described in the Customizers Guide.

LoadReportTemplate will stop and restart the Method Server, this is not an option it is automatic

LoadFromFile does not affect the Method Server but does require the report template xml files to be located in <Windchill_Home>/loadFiles/Reports unless a full path is specified in the associated csv

Export/Import of Templates Report templates can be exported using a command line utility

from the server, see Windchill Customizers Guide – Report Generation. This creates two files a csv load file and an XML representation of the report. The csv references the XML file(s).

Reports can be imported into another system using either, LoadReportTemplate or LoadFromFile both methods are described in the Customizers Guide.

LoadReportTemplate will stop and restart the Method Server, this is not an option it is automatic

LoadFromFile does not affect the Method Server but does require the report template xml files to be located in <Windchill_Home>/loadFiles/Reports unless a full path is specified in the associated csv

Configuration – Export/ImportConfiguration – Export/Import

Page 109: Windchill Reporting R6.2

© 2001 PTC 109

Export of Query Builder Templates.To export a single report

Open a command window, with the correct codebase and paths set

Change location to a directory where you wish to place the output

Execute the following command:

java wt.query.template.ExportReportTemplate WRKShopIBACost

To export multiple reports you can use a wild card:

java wt.query.template.ExportReportTemplate WRKShop%

This will create xml files for each report and a single csv file.

Export of Query Builder Templates.To export a single report

Open a command window, with the correct codebase and paths set

Change location to a directory where you wish to place the output

Execute the following command:

java wt.query.template.ExportReportTemplate WRKShopIBACost

To export multiple reports you can use a wild card:

java wt.query.template.ExportReportTemplate WRKShop%

This will create xml files for each report and a single csv file.

Configuration – Export ExampleConfiguration – Export Example

Page 110: Windchill Reporting R6.2

© 2001 PTC 110

Import of Query Builder TemplatesThe csv file may be placed in any location, the xml files sholud be placed in <Windchill_Home>/loadfiles/reportsIt is possible to import the xml files from an alternate loaction if you wish to enter the full path in addition to the file name in the csv file

Open a command window, with the correct codebase and paths set

Execute the following command:

java wt.load.LoadFromFile -d <PATH>/exportreports.csv

Import of Query Builder TemplatesThe csv file may be placed in any location, the xml files sholud be placed in <Windchill_Home>/loadfiles/reportsIt is possible to import the xml files from an alternate loaction if you wish to enter the full path in addition to the file name in the csv file

Open a command window, with the correct codebase and paths set

Execute the following command:

java wt.load.LoadFromFile -d <PATH>/exportreports.csv

Configuration – Export Example/ImportConfiguration – Export Example/Import

Page 111: Windchill Reporting R6.2

© 2001 PTC 111

Wild Card This is information has been requested from technical support

and will be added when available (Not applicable to R5.x)

Wild Card This is information has been requested from technical support

and will be added when available (Not applicable to R5.x)

Configuration – Wild CardConfiguration – Wild Card

Page 112: Windchill Reporting R6.2

© 2001 PTC 112

It is possible to create reports that produce excess results causing a negative impact on performance. To avoid issues in a production system reports should always be

developed on a test system which holds a representative amount and type of data.

Where possible all reports should be developed with suitable criteria which will limit processing.

To avoid a large queries being run it is possible to limit the number of results returned

The property which controls this is wt.pom.queryLimit. This should be set in the db.properties file. The default is unlimited.

This will affect Report Templates, Local Search and any database queries using the wt.query package classes and methods and Windchill itself

It should not be set too low or you will limit the queries that Windchill has to perform to run correctly, the value should be in the thousands, e.g. 5000 is not a large setting for this property

It is possible to create reports that produce excess results causing a negative impact on performance. To avoid issues in a production system reports should always be

developed on a test system which holds a representative amount and type of data.

Where possible all reports should be developed with suitable criteria which will limit processing.

To avoid a large queries being run it is possible to limit the number of results returned

The property which controls this is wt.pom.queryLimit. This should be set in the db.properties file. The default is unlimited.

This will affect Report Templates, Local Search and any database queries using the wt.query package classes and methods and Windchill itself

It should not be set too low or you will limit the queries that Windchill has to perform to run correctly, the value should be in the thousands, e.g. 5000 is not a large setting for this property

Configuration – Database ImpactConfiguration – Database Impact

Page 113: Windchill Reporting R6.2

© 2001 PTC 113

AdvantagesAdvantages

Use of the OOTB GUI allows easy modification of Reports as business requirements change

If alternate outputs are required these can be dealt with using manipulation of the xml output

With an extension to create Excel web query files the business can produce their own charts and calculations

Charting can be extended to allow the production of different formats and styles of graphical output

Use of the OOTB GUI allows easy modification of Reports as business requirements change

If alternate outputs are required these can be dealt with using manipulation of the xml output

With an extension to create Excel web query files the business can produce their own charts and calculations

Charting can be extended to allow the production of different formats and styles of graphical output

Page 114: Windchill Reporting R6.2

© 2001 PTC 114

LimitationsLimitations

Data held as Binary Large Object format can not sensibly be used in queries or as output. E.g.

File Content Access Control Lists for an object Any objects not implementing Persistable or

ObjectMappable

Data held as Binary Large Object format can not sensibly be used in queries or as output. E.g.

File Content Access Control Lists for an object Any objects not implementing Persistable or

ObjectMappable

Page 115: Windchill Reporting R6.2

© 2001 PTC 115

Notes On TestingNotes On Testing

While initially it is easier to test a reports on a system where there is little or no data this is only acceptable for initial development.

It is important that you ensure your test data will return enough information to establish any possible performance problem.

You also need to ensure that you have data that will both satisfy and not satisfy the queries you test.

Creating and checking the data may frequently take longer than creating the query itself.

When you are creating queries which will have a large number of criteria it is easier to build this up gradually. Otherwise you are left with a query which returns zero results and you will not know which criteria is the culprit.

While initially it is easier to test a reports on a system where there is little or no data this is only acceptable for initial development.

It is important that you ensure your test data will return enough information to establish any possible performance problem.

You also need to ensure that you have data that will both satisfy and not satisfy the queries you test.

Creating and checking the data may frequently take longer than creating the query itself.

When you are creating queries which will have a large number of criteria it is easier to build this up gradually. Otherwise you are left with a query which returns zero results and you will not know which criteria is the culprit.

Page 116: Windchill Reporting R6.2

© 2001 PTC 116

Objects & Relationships SummaryObjects & Relationships Summary

This list is a sub set of the most commonly used relationships.

Document - Internal

This list is a sub set of the most commonly used relationships.

Document - Internal

Part - InternalPart - Internal

Relationship From Class Role Link Class To Class Role Master Iteration WTDocument B wt.doc.MasterIteration WTDocumentMaster A

Document Usage (Structure Usage)

WTDocument A WTDocumentUsageLink WTDocumentMaster B

Document References WTDocument A WTDocumentDependencyLink WTDocument B

Relationship From Class Role Link Class To Class Role

Master Iteration WTPart B wt.part.MasterIteration (Iterated Usage Link)

WTPartMaster A

Part Usage WTPart A WTPartUsageLink WTPartMaster B

Part - DocumentPart - DocumentRelationship From Class Role Link Class To Class Role Described By WTPart A WTPartDescribeLink WTDocument B

References WTPart A WTPartReferenceLink (Part Reference)

WTDocumentMaster B

Page 117: Windchill Reporting R6.2

© 2001 PTC 117

Objects & Relationships SummaryObjects & Relationships Summary

Change Objects – Internal, (Package wt.change2)Change Objects – Internal, (Package wt.change2)

From Class Role Link Class To Class Role ChangeRequest2 A FormalizedBy ChangeIssue B

ChangeRequest2 A ResearchedBy ChangeInvestigation B

ChangeInvestigation A DetailedBy AnalysisActivity B

ChangeRequest2 A ResearchedBy ChangeProposal B

ChangeProposal A DetailedBy AnalysisActivity B

ChangeRequest2 A AddressedBy2 ChangeOrder2 B

ChangeOrder2 A IncludedIn2 ChangeActivity2 B

Change Objects – External, (Package wt.change2)

Changable2 can be either Document or Part

Change Objects – External, (Package wt.change2)

Changable2 can be either Document or Part

From Class Role Link Class To Class Role ChangeRequest2 B RelevantRequestData2 Changeable2 A

AnalysisActivity B RelevantAnalysisData Changeable2 A

ChangeActivity2 B AffectedActivityData Changeable2 A

ChangeActivity2 B ChangeRecord2 Changeable2 A

Page 118: Windchill Reporting R6.2

© 2001 PTC 118

Objects & Relationships SummaryObjects & Relationships Summary

WorkflowWorkflow

From Class Role Link Class To Class Role WfProcess N/A Parent Process Ref WfAssignedActivity N/A

WfAssignedActivity A ActivityAssignmentLink WfAssignment B

WfAssignment B WorkItemLink WorkItem A

ChangeActivity2 N/A Primary Business Object WTObject N/A

Lifecycle HistoryLifecycle History

From Class Role Link Class To Class Role LifeCycleManaged A ObjectHistory LifeCycleHistory B