<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qml SYSTEM "/wt/query/qml/qml.dtd">
<qml bypassAccessControl="true">
	<parameter name="ECN state equal to" type="wt.lifecycle.State">
		<parameterDefault isMacro="false">
			IMPLEMENTATION
		</parameterDefault>
	</parameter>
	<parameter name="ECN state not equal to" type="wt.lifecycle.State">
		<parameterDefault isMacro="false">
			RESOLVED
		</parameterDefault>
	</parameter>
	<statement>
		<query>
			<select distinct="true" group="true">
				<object alias="Change Notice (wt.change2.WTChangeOrder2)" heading="Enterprise Change Notice" propertyName=""/>
				<column alias="ECN CreatedBy" heading="ECN CreatedBy" isExternal="false" propertyName="name" selectOnly="false" type="java.lang.String">
					name
				</column>
				<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="ECN Creation Date" isExternal="false" propertyName="createTimestamp" selectOnly="false" type="java.sql.Timestamp">
					thePersistInfo.createStamp
				</column>
				<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="ECN Need Date" isExternal="false" propertyName="needDate" selectOnly="false" type="java.sql.Timestamp">
					needDate
				</column>
				<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="ECN State" isExternal="false" propertyName="lifeCycleState" selectOnly="false" type="wt.lifecycle.State">
					state.state
				</column>
				<object alias="Change Request (wt.change2.WTChangeRequest2)" heading="Related ECR" propertyName=""/>
				<column alias="ECR CreatedBy" heading="ECR CreatedBy Name" isExternal="false" propertyName="name" selectOnly="false" type="java.lang.String">
					name
				</column>
				<column alias="wt.workflow.engine.WfActivity" heading="Name" isExternal="false" propertyName="name" selectOnly="false" type="java.lang.String">
					name
				</column>
				<column alias="TaskUser" heading="Task Owner Name" isExternal="false" propertyName="name" selectOnly="false" type="java.lang.String">
					name
				</column>
				<column alias="Work Item" heading="Status" isExternal="false" propertyName="status" selectOnly="false" type="wt.workflow.work.WfAssignmentState">
					status
				</column>
				<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="Owner Id" isExternal="false" propertyName="creator.objectId.id" selectOnly="false" type="long">
					creator.key.id
				</column>
			</select>
			<from>
				<table alias="Change Notice (wt.change2.WTChangeOrder2)" isExternal="false">
					wt.change2.WTChangeOrder2
				</table>
				<table alias="Workflow Process" isExternal="false">
					wt.workflow.engine.WfProcess
				</table>
				<table alias="wt.workflow.engine.WfActivity" isExternal="false">
					wt.workflow.engine.WfActivity
				</table>
				<table alias="Change Activity" isExternal="false">
					wt.change2.WTChangeActivity2
				</table>
				<table alias="Work Item" isExternal="false">
					wt.workflow.work.WorkItem
				</table>
				<table alias="ECN CreatedBy" isExternal="false">
					wt.org.WTUser
				</table>
				<table alias="Change Request (wt.change2.WTChangeRequest2)" isExternal="false">
					wt.change2.WTChangeRequest2
				</table>
				<table alias="ECR CreatedBy" isExternal="false">
					wt.org.WTUser
				</table>
				<table alias="TaskUser" isExternal="false">
					wt.org.WTUser
				</table>
			</from>
			<where>
				<compositeCondition type="and">
					<condition>
						<operand>
							<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="State" isExternal="false" propertyName="lifeCycleState" selectOnly="false" type="wt.lifecycle.State">
								state.state
							</column>
						</operand>
						<operator type="notEqual"/>
						<operand>
							<constant heading="CANCELLED" isMacro="false" type="wt.lifecycle.State">
								CANCELLED
							</constant>
						</operand>
					</condition>
					<condition>
						<operand>
							<column alias="Workflow Process" heading="State" isExternal="false" propertyName="state" selectOnly="false" type="wt.workflow.engine.WfState">
								state
							</column>
						</operand>
						<operator type="equal"/>
						<operand>
							<constant heading="OPEN_RUNNING" isMacro="false" type="wt.workflow.engine.WfState">
								OPEN_RUNNING
							</constant>
						</operand>
					</condition>
					<compositeCondition type="or">
						<condition>
							<operand>
								<column alias="Workflow Process" heading="Name" isExternal="false" propertyName="name" selectOnly="false" type="java.lang.String">
									name
								</column>
							</operand>
							<operator type="like"/>
							<operand>
								<constant heading="%ECN%" isMacro="false" type="java.lang.Object">
									%ECN%
								</constant>
							</operand>
						</condition>
						<condition>
							<operand>
								<column alias="Workflow Process" heading="Name" isExternal="false" propertyName="name" selectOnly="false" type="java.lang.String">
									name
								</column>
							</operand>
							<operator type="like"/>
							<operand>
								<constant heading="%CA%" isMacro="false" type="java.lang.Object">
									%CA%
								</constant>
							</operand>
						</condition>
					</compositeCondition>
					<compositeCondition type="or">
						<condition>
							<operand>
								<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="Team (teamId).Object Id.Id" isExternal="false" propertyName="teamId.objectId.id" selectOnly="false" type="long">
									teamId.key.id
								</column>
							</operand>
							<operator type="equal"/>
							<operand>
								<column alias="Workflow Process" heading="Team Id.Object Id.Id" isExternal="false" propertyName="teamId.objectId.id" selectOnly="false" type="long">
									teamId.key.id
								</column>
							</operand>
						</condition>
						<condition>
							<operand>
								<column alias="Change Activity" heading="Team (teamId).Object Id.Id" isExternal="false" propertyName="teamId.objectId.id" selectOnly="false" type="long">
									teamId.key.id
								</column>
							</operand>
							<operator type="equal"/>
							<operand>
								<column alias="Workflow Process" heading="Team Id.Object Id.Id" isExternal="false" propertyName="teamId.objectId.id" selectOnly="false" type="long">
									teamId.key.id
								</column>
							</operand>
						</condition>
					</compositeCondition>
					<condition>
						<operand>
							<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="State" isExternal="false" propertyName="lifeCycleState" selectOnly="false" type="wt.lifecycle.State">
								state.state
							</column>
						</operand>
						<operator type="equal"/>
						<operand>
							<parameterTarget name="ECN state equal to"/>
						</operand>
					</condition>
					<condition>
						<operand>
							<column alias="Change Notice (wt.change2.WTChangeOrder2)" heading="State" isExternal="false" propertyName="lifeCycleState" selectOnly="false" type="wt.lifecycle.State">
								state.state
							</column>
						</operand>
						<operator type="notEqual"/>
						<operand>
							<parameterTarget name="ECN state not equal to"/>
						</operand>
					</condition>
				</compositeCondition>
			</where>
			<orderBy>
				<orderByItem type="asc">
					<columnTarget heading="Owner Id"/>
				</orderByItem>
				<orderByItem type="asc">
					<columnTarget heading="ECN Need Date"/>
				</orderByItem>
			</orderBy>
			<linkJoin>
				<join name="wt.change2.IncludedIn2">
					<aliasTarget alias="Change Notice (wt.change2.WTChangeOrder2)"/>
					<aliasTarget alias="Change Activity"/>
				</join>
				<join name="wt.change2.AddressedBy2">
					<aliasTarget alias="Change Request (wt.change2.WTChangeRequest2)"/>
					<aliasTarget alias="Change Notice (wt.change2.WTChangeOrder2)"/>
				</join>
			</linkJoin>
			<referenceJoin>
				<join name="parentProcessRef">
					<aliasTarget alias="wt.workflow.engine.WfActivity"/>
					<aliasTarget alias="Workflow Process"/>
				</join>
				<join name="source">
					<aliasTarget alias="Work Item"/>
					<aliasTarget alias="wt.workflow.engine.WfActivity"/>
				</join>
				<join name="creator">
					<aliasTarget alias="Change Notice (wt.change2.WTChangeOrder2)"/>
					<aliasTarget alias="ECN CreatedBy"/>
				</join>
				<join name="creator">
					<aliasTarget alias="Change Request (wt.change2.WTChangeRequest2)"/>
					<aliasTarget alias="ECR CreatedBy"/>
				</join>
				<join name="ownership.owner">
					<aliasTarget alias="Work Item"/>
					<aliasTarget alias="TaskUser"/>
				</join>
			</referenceJoin>
		</query>
	</statement>
</qml>
