<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
    <property name="createdBy">Eclipse BIRT Designer Version 4.4.2.v201410272105 Build &lt;4.4.2.v20150217-1805></property>
    <property name="units">in</property>
    <property name="iconFile">/templates/blank_report.gif</property>
    <property name="bidiLayoutOrientation">ltr</property>
    <property name="imageDPI">120</property>
    <parameters>
        <scalar-parameter name="targetProcessNames" id="56">
            <text-property name="promptText">Processes to export</text-property>
            <property name="valueType">dynamic</property>
            <property name="isRequired">false</property>
            <property name="dataSetName">Process Selection Data Set</property>
            <expression name="valueExpr" type="javascript">dataSetRow["ProcessName"]</expression>
            <property name="dataType">string</property>
            <property name="distinct">true</property>
            <list-property name="selectionList"/>
            <property name="paramType">multi-value</property>
            <property name="controlType">list-box</property>
            <property name="mustMatch">true</property>
            <property name="fixedOrder">true</property>
            <structure name="format">
                <property name="category">Unformatted</property>
            </structure>
        </scalar-parameter>
        <scalar-parameter name="generateSinglePredecessor" id="102">
            <text-property name="helpText">MS Project Excel import only supports importing one predecessor</text-property>
            <text-property name="promptText">Use only last predecessor</text-property>
            <property name="valueType">static</property>
            <property name="dataType">boolean</property>
            <property name="distinct">true</property>
            <simple-property-list name="defaultValue">
                <value type="constant">False</value>
            </simple-property-list>
            <list-property name="selectionList"/>
            <property name="paramType">simple</property>
            <property name="controlType">check-box</property>
            <structure name="format"/>
        </scalar-parameter>
    </parameters>
    <data-sources>
        <oda-data-source extensionID="de.methodpark.pkit.datasource" name="Stages Data Source" id="7">
            <property name="serverUrl">http://localhost:8081</property>
            <property name="user">MetricUser</property>
            <encrypted-property name="password" encryptionID="base64">cGFzcw==</encrypted-property>
        </oda-data-source>
    </data-sources>
    <data-sets>
        <oda-data-set extensionID="de.methodpark.pkit.datasource.dataSet" name="Process Selection Data Set" id="8">
            <list-property name="columnHints">
                <structure>
                    <property name="columnName">ProcessName</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">ProcessName</text-property>
                </structure>
            </list-property>
            <list-property name="parameters"/>
            <structure name="cachedMetaData">
                <list-property name="resultSet">
                    <structure>
                        <property name="position">1</property>
                        <property name="name">ProcessName</property>
                        <property name="dataType">string</property>
                    </structure>
                </list-property>
            </structure>
            <property name="dataSource">Stages Data Source</property>
            <list-property name="resultSet">
                <structure>
                    <property name="position">1</property>
                    <property name="name">ProcessName</property>
                    <property name="nativeName">ProcessName</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
            </list-property>
            <xml-property name="queryText"><![CDATA[/////////////////////////////////////Functions///////////////////////////////////////

	function debug(s) {
		return;  // comment out to start debugging
		dataset.setColumnValue("debug", s);
		dataset.storeResultRow();
	}
	
	/////////////////////////////////////Main Script///////////////////////////////////////

	asCurrentUser.run( 
	 function () {

		var startProject = pkit.getCurrentProject();
		var currentProcess = startProject.getEntities("containsProcess@SYSTEM")[0];

		debug("currentProcess=" + currentProcess);
		debug("currentProcessVersion=" + currentProcess.getProperty("Version"));

		var activityIndex = currentProcess.getEntities("containsActivityIndex@SYSTEM")[0];
		var toplevelProcesses = activityIndex.getEntities("hierarchy::hierarchic,targetrole=children");
		for (var i = 0; i < toplevelProcesses.length; i++) {
		  var toplevelProcess = toplevelProcesses[i];
		  dataset.setColumnValue("ProcessName", toplevelProcess.getProperty("DisplayName"));
		  dataset.storeResultRow();
		}
	});]]></xml-property>
            <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
  <Version>2.0</Version>
  <design:ResultSets derivedMetaData="false">
    <design:resultSetDefinitions>
      <design:resultSetColumns>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>ProcessName</design:name>
              <design:position>1</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>ProcessName</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
      </design:resultSetColumns>
      <design:criteria/>
    </design:resultSetDefinitions>
  </design:ResultSets>
</model:DesignValues>]]></xml-property>
            <list-property name="privateDriverProperties">
                <ex-property>
                    <name>columnSet</name>
                    <value>ProcessName</value>
                </ex-property>
                <ex-property>
                    <name>columnTypeSet</name>
                    <value>String</value>
                </ex-property>
                <ex-property>
                    <name>currentMetric</name>
                    <value>[[[FCA|Standard Processes|Product Development|Software Engineering:metric] PIID]]</value>
                </ex-property>
                <ex-property>
                    <name>currentWorkspace</name>
                </ex-property>
                <ex-property>
                    <name>currentProcessVersion</name>
                </ex-property>
                <ex-property>
                    <name>currentFolder</name>
                </ex-property>
            </list-property>
        </oda-data-set>
        <oda-data-set extensionID="de.methodpark.pkit.datasource.dataSet" name="Process Export Data Set" id="9">
            <property name="nullsOrdering">nulls lowest</property>
            <list-property name="columnHints">
                <structure>
                    <property name="columnName">debug</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">debug</text-property>
                </structure>
                <structure>
                    <property name="columnName">SequenceNumber</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">SequenceNumber</text-property>
                </structure>
                <structure>
                    <property name="columnName">ActivityLevel</property>
                    <property name="analysis">measure</property>
                    <text-property name="heading">ActivityLevel</text-property>
                </structure>
                <structure>
                    <property name="columnName">ActivityType</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">ActivityType</text-property>
                </structure>
                <structure>
                    <property name="columnName">ActivityName</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">ActivityName</text-property>
                </structure>
                <structure>
                    <property name="columnName">ResponsibleRoleName</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">ResponsibleRoleName</text-property>
                </structure>
                <structure>
                    <property name="columnName">SupportingRoleName</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">SupportingRoleName</text-property>
                </structure>
                <structure>
                    <property name="columnName">Inputs</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">Inputs</text-property>
                </structure>
                <structure>
                    <property name="columnName">Outputs</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">Outputs</text-property>
                </structure>
                <structure>
                    <property name="columnName">ActivityURL</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">ActivityURL</text-property>
                </structure>
                <structure>
                    <property name="columnName">InternalId</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">InternalId</text-property>
                </structure>
                <structure>
                    <property name="columnName">PredecessorIds</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">PredecessorIds</text-property>
                </structure>
                <structure>
                    <property name="columnName">Duration</property>
                    <property name="analysis">dimension</property>
                    <text-property name="heading">Duration</text-property>
                </structure>
            </list-property>
            <list-property name="parameters"/>
            <structure name="cachedMetaData">
                <list-property name="resultSet">
                    <structure>
                        <property name="position">1</property>
                        <property name="name">debug</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">2</property>
                        <property name="name">SequenceNumber</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">3</property>
                        <property name="name">ActivityLevel</property>
                        <property name="dataType">integer</property>
                    </structure>
                    <structure>
                        <property name="position">4</property>
                        <property name="name">ActivityType</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">5</property>
                        <property name="name">ActivityName</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">6</property>
                        <property name="name">ResponsibleRoleName</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">7</property>
                        <property name="name">SupportingRoleName</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">8</property>
                        <property name="name">Inputs</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">9</property>
                        <property name="name">Outputs</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">10</property>
                        <property name="name">ActivityURL</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">11</property>
                        <property name="name">InternalId</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">12</property>
                        <property name="name">PredecessorIds</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">13</property>
                        <property name="name">Duration</property>
                        <property name="dataType">string</property>
                    </structure>
                </list-property>
            </structure>
            <property name="rowFetchLimit">0</property>
            <method name="beforeOpen"><![CDATA[var targetProcessNames = reportContext.getParameterValue("targetProcessNames");
var targetProcessNameList = "";
if (targetProcessNames != null &amp;&amp; targetProcessNames.length > 0)
	targetProcessNameList = targetProcessNames.join("|");
this.queryText = String(this.queryText).replace("PARAMETER_PROCESS_NAMES", targetProcessNameList);

this.queryText = String(this.queryText).replace("PARAMETER_SINGLE_PREDECESSOR", reportContext.getParameterValue("generateSinglePredecessor"));]]></method>
            <property name="dataSource">Stages Data Source</property>
            <list-property name="resultSet">
                <structure>
                    <property name="position">1</property>
                    <property name="name">debug</property>
                    <property name="nativeName">debug</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">2</property>
                    <property name="name">SequenceNumber</property>
                    <property name="nativeName">SequenceNumber</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">3</property>
                    <property name="name">ActivityLevel</property>
                    <property name="nativeName">ActivityLevel</property>
                    <property name="dataType">integer</property>
                    <property name="nativeDataType">4</property>
                </structure>
                <structure>
                    <property name="position">4</property>
                    <property name="name">ActivityType</property>
                    <property name="nativeName">ActivityType</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">5</property>
                    <property name="name">ActivityName</property>
                    <property name="nativeName">ActivityName</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">6</property>
                    <property name="name">ResponsibleRoleName</property>
                    <property name="nativeName">ResponsibleRoleName</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">7</property>
                    <property name="name">SupportingRoleName</property>
                    <property name="nativeName">SupportingRoleName</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">8</property>
                    <property name="name">Inputs</property>
                    <property name="nativeName">Inputs</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">9</property>
                    <property name="name">Outputs</property>
                    <property name="nativeName">Outputs</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">10</property>
                    <property name="name">ActivityURL</property>
                    <property name="nativeName">ActivityURL</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">11</property>
                    <property name="name">InternalId</property>
                    <property name="nativeName">InternalId</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">12</property>
                    <property name="name">PredecessorIds</property>
                    <property name="nativeName">PredecessorIds</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
                <structure>
                    <property name="position">13</property>
                    <property name="name">Duration</property>
                    <property name="nativeName">Duration</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
            </list-property>
            <xml-property name="queryText"><![CDATA[/////////////////////////////////////Parameters///////////////////////////////////////

var params = {
	processNames: "PARAMETER_PROCESS_NAMES",
	generateSinglePredecessor: PARAMETER_SINGLE_PREDECESSOR
}

///

var showTailoredCommentsMode = "all";

var CONFIG = {	
    assocStrings : {
        activitySequenceSuccessor : "sequence,targetrole=successor",
        activitySequencePredecessor : "sequence,targetrole=predecessor",
        artifactInput : "input",
        artifactOutput : "output",
        roleResponsible : "responsible",
        roleAccountable : "accountable",
		//artifactMilestone : "relevant mandatory mandatoryConditional",
		artifactMilestone : "relevant",
        phaseExecute: "execute"
    }
}

var debugPE = function (pe) {
	if (pe == undefined)
		return "UNDEFINED";
	var type = getType(pe);
	var subtype = getSubType(pe);
	if (subtype != undefined)
		type += "/" + subtype;
	type += "[" + getId(pe) + "]";
	return type + ":" + getDisplayName(pe);
}

/**
 * Creates a representation for an array of process elements that can be used for debugging
 */
var debugPEs = function (pes) {
	var ret = "(#" + pes.length + ") ";
	for (var i=0; i < pes.length; i++)
		ret += debugPE(pes[i]) + " ";
	return ret;
}

var debugASSOC = function (assoc) {
	var ret = "[source=" + debugPE(assoc.getSource()) + ", target=" + debugPE(assoc.getTarget()) + ", comment=" + getComment(assoc) + "]";
	return ret;
}

function ArcSet() {
	var adj = [];
	var inDegree = [];
	var nodes = [];
	var size = 0;
	var maxColumnLength = 0;
	var zeroDegreeNodes = [];
	var tiebreakers = [];
	var usedTiebreakers = false;
	var nodeToColumn = [];
	var nodeDependsOn = [];
	
	this.findStartNodes = function() {
		var tiebreaker = null;
		var tiebreakerInDegree = -1;
		
		for (var i in inDegree)
			if (inDegree[i] == 0)
				zeroDegreeNodes.push(nodes[i]);
			else if (tiebreakerInDegree < 0 || inDegree[i] < tiebreakerInDegree) {
				tiebreaker = nodes[i];
				tiebreakerInDegree = inDegree[i];
			}
		
		if (zeroDegreeNodes.length == 0)
			tiebreakers = [ tiebreaker ];
		
		// safeguard
		if (zeroDegreeNodes.length + tiebreakers.length == 0)
			fatal("No start nodes found!");
	}
	
	this.getNextNodes = function() {
		var ret = zeroDegreeNodes.concat(tiebreakers);
		if (ret.length == 0) {
			debug("cycle detected - need to restart the start node search");
			this.findStartNodes();
			
			ret = zeroDegreeNodes.concat(tiebreakers);
			if (ret.length == 0)
				fatal("WHAT???");
			
			usedTiebreakers = true;
		}
		zeroDegreeNodes = [];
		tiebreakers = [];
		return ret;
	}

	this.addNode = function (node) {
		var nodeId = this.id(node);
		
		// Prevent from nodes being added twice
		if (adj[nodeId] != undefined)
			return;
		
		adj[nodeId] = [];
		inDegree[nodeId] = 0;
		nodes[nodeId] = node;
		size++;
	};
	
	this.deleteNode = function(node, columnNumber) {
		var nodeId = this.id(node);
		
		var adjList = adj[nodeId];
		if (adjList == undefined)
			return;
		
		for (var i = 0; i < adjList.length; i++) {
			var adjNode = nodes[adjList[i]];
			// Nodes might have been removed with arcs remaining by using tiebreaker,
			// so they might be undefined.
			if (adjNode != undefined) {				
				if (--inDegree[adjList[i]] == 0)
					zeroDegreeNodes.push(adjNode);
				
				if (nodeDependsOn[this.id(adjNode)] == undefined)
					nodeDependsOn[this.id(adjNode)] = [];
				nodeDependsOn[this.id(adjNode)].push(node);
			}
		}

		nodeToColumn[this.id(node)] = columnNumber;
		
		delete adj[nodeId];
		delete inDegree[nodeId];
		delete nodes[nodeId];
		size--;
	}
	
	this.getSize = function() {
		return size;
	}
	
	this.addArc = function (sourceNode, targetNode) {
		if (sourceNode == null || targetNode == null)
			fatal("addArc: NULL source=" + debugPE(sourceNode) + ", target=" + debugPE(targetNode));
		
		var sourceId = this.id(sourceNode);
		var targetId = this.id(targetNode);
		
		if (sourceId === targetId) {
			//debug("addArc: IGNORED IDENT source=" + debugPE(sourceNode) + ", target=" + debugPE(targetNode));
			return;
		}
		
		var arcs = adj[sourceId];
		
		if (arcs === undefined) {
			//debug("addArc: IGNORED UNKNOWN SOURCE source=" + debugPE(sourceNode) + ", target=" + debugPE(targetNode));
			return;
		}
		
		if (adj[targetId] === undefined) {
			//debug("addArc: IGNORED UNKNOWN TARGET source=" + debugPE(sourceNode) + ", target=" + debugPE(targetNode));
			return;
		}
		
		var exists = false;
		
		for (var i = 0; i < arcs.length; i++) {
			if (targetId === arcs[i])
				exists = true;
		}
		
		if (!exists) {
			arcs.push(targetId);
			adj[sourceId] = arcs;
			inDegree[targetId]++;
			//debug("addArc: ADDED source=" + debugPE(sourceNode) + ", target=" + debugPE(targetNode));
		} else {
			//debug("addArc: IGNORED EXISTS source=" + debugPE(sourceNode) + ", target=" + debugPE(targetNode));
		}
	};
	
	this.compactifyGrid = function (columns) {		
		
		// The graph might not be optimal, because the tiebreaker usage
		// ignored some arcs to break the cycles. We try to optimize the
		// graph now.
		
		debug("compactifyGrid: start");
		for (var columnNumber = 1; columnNumber < columns.length; columnNumber++) {
			var column = columns[columnNumber];
			for (var i = 0; i < column.length; i++) {
				var node = column[i];
				var nodeDepends = nodeDependsOn[this.id(node)];
				if (nodeDepends == undefined)
					continue;
				var newColumn = 0;
				//debug("node " + debugPE(node) + " depends on " + nodeDepends.length + " other nodes");
				for (var k = 0; k < nodeDepends.length; k++) {
					dependingNodeColumn = nodeToColumn[this.id(nodeDepends[k])];
					//debug("checking dependent node " + debugPE(nodeDepends[k]) + " in column " + dependingNodeColumn);
					if (dependingNodeColumn > newColumn) {
						newColumn = dependingNodeColumn;
						//debug("increased newColumn to " + newColumn);
					}
				}
				newColumn++;
				//debug("new column is " + newColumn);
				if (newColumn < columnNumber) {
					//debug("moving " + debugPE(node) + " to column " + newColumn);
					columns[newColumn].push(node);
					columns[columnNumber].splice(i, 1);
					i--;  // Ugly, but necessary, because we just spliced away the previous node and thus have to repeat the loop with the same index.
					nodeToColumn[this.id(node)] = newColumn;
				}
			}
		}
		
		// Delete empty columns at the end.
		var newColumnCount = columns.length;
		while (columns[--newColumnCount] == 0)
			;
		
		// Delete empty columns in the middle and recalculate the maximum column length.
		var newMaxColumnLength = 0;
		for (var i = 0; i < newColumnCount; i++) {
			if (newMaxColumnLength < columns[i].length)
				newMaxColumnLength = columns[i].length;
			if (columns[i].length == 0) {
				columns.splice(i, 1);
				newColumnCount--;
			}
		}
		maxColumnLength = newMaxColumnLength;

		debug("compactifyGrid: end");
		
		return newColumnCount;
	};
	
	this.topologySort = function() {
		/*
		 * The basic idea of the sorting algorithm is:
		 * 1. Put all nodes in an arc set.
		 * 2. Find nodes with zero in-degree (= no predecessors).
		 *    Here we need to use a tiebreaker, if there are no nodes with zero in-degree in case of a cycle.
		 *    We use the successor nodes of the currently removed nodes with minimum in-degree for this.
		 * 3. Remove them from arc set.
		 * 4. Iterate until arc set is empty.
		 *
		 * Details:
		 * https://courses.cs.washington.edu/courses/cse326/03wi/lectures/RaoLect20.pdf
		 */
		debug("topologySort: start");
		
		this.dump("init");
		
		usedTiebreakers = false;
		
		this.findStartNodes();
		
		var columnCount = 0;
		var columns = [];
		
		// Graph sorting is tricky when the graph might have cycles.
		// To make sure, that we absolutely don't run into an endless loop,
		// we have columns maximum.
		var MAX_COLUMNS = 1000;
		
		while (this.getSize() > 0 &amp;&amp; columnCount < MAX_COLUMNS) { // SAFEGUARD
			var passNodes = this.getNextNodes();
			var column = [];
			for (var i = 0; i < passNodes.length; i++) {
				node = passNodes[i];
				column.push(node);
				this.deleteNode(node, columnCount);
				//debug("COL " + columnCount + ": " + debugPE(node));
			}
			this.dump(columnCount);
			columns.push(column);
			
			if (maxColumnLength < column.length)
				maxColumnLength = column.length;
			
			columnCount++;
		}
		if (columnCount == MAX_COLUMNS) {
			var msg = "More than " + MAX_COLUMNS + " columns detected - suspecting endless loop";
			debug("ERROR: " + msg);
			fatal(msg);
		}
		
		debug("topologySort: end");
		
		if (usedTiebreakers)
			columnCount = this.compactifyGrid(columns);
		
		return columns;
	};
	
	this.getMaxColumnLength = function() {
		return maxColumnLength;
	};
	
	this.containsElement = function (element) {
		return adj[this.id(element)] != undefined;
	};
	
	this.id = function (element) {
		//debug("id(" + debugPE(element) + ")");
		return getType(element) + "/" + getId(element);
	};
	
	this.dump = function(msg) {
		return;
		for (var id in adj) {
			debug("DUMP " + msg + ": id " + id + " node=" + debugPE(nodes[id]) + " inDegree=" + inDegree[id] + " adj=" + adj[id]);
		}
	};
}

function getActivityDependencyColumns(activities) {
	var arcSet = new ArcSet();
	
	for (var i = 0; i < activities.length; i++)
		arcSet.addNode(activities[i]);

	for (var i = 0; i < activities.length; i++) {
		var activity = activities[i];
		
		var successors = getSuccessors(activity);
		for (var j = 0; j < successors.length; j++)
			if (!isStartActivity(activity))
				arcSet.addArc(successors[j], activity);

		var predecessors = getPredecessors(activity);
		for (var j = 0; j < predecessors.length; j++)
			arcSet.addArc(activity, predecessors[j]);

		var outputAssocs = filterVisibleAssociationTargets(activity.getAssociations(CONFIG.assocStrings.artifactOutput));
		var virtualSequences = getVirtualSequences(activity, outputAssocs, CONFIG.assocStrings.artifactInput, arcSet);
		for (var j = 0; j < virtualSequences.length; j++) {
			var virtualSuccessor = virtualSequences[j].getTarget();
			if (!isStartActivity(virtualSuccessor))
				arcSet.addArc(activity, virtualSuccessor);
		}
	}

	return arcSet.topologySort();
}

function getActivityDependencyOrder(activities) {
	var columns = getActivityDependencyColumns(activities);
	var ret = [];
	for (var i = 0; i < columns.length; i++) {
		for (var j = 0; j < columns[i].length; j++)
			ret.push(columns[i][j]);
	}
	return ret;
}

function filterVisibleAssociationTargets(associations) {
	var ret = [];
	for (var i = 0; i < associations.length; i++)
		if (isVisible(associations[i].getTarget()))
			ret.push(associations[i]);
		else
			debug("filterVisibleAssociationTargets: SKIPPED non-visible " + debugPE(associations[i].getTarget()));
	return ret;
}

function filterVisibleEntities(entities) {
	var ret = [];
	for (var i = 0; i < entities.length; i++)
		if (isVisible(entities[i]))
			ret.push(entities[i]);
		else
			debug("filterVisibleEntities: SKIPPED non-visible " + debugPE(entities[i]));
	return ret;
}

function getSuccessors(activity) {
	return getAssociationTargets(getSuccessorAssociations(activity));
}

function getPredecessors(activity) {
	return getAssociationTargets(getPredecessorAssociations(activity));
}

function getSuccessorAssociations(activity) {
	return findVisibleSequenceElementAssociations(activity, activity, CONFIG.assocStrings.activitySequenceSuccessor, "", [], false);
}

function getPredecessorAssociations(activity) {
	return findVisibleSequenceElementAssociations(activity, activity, CONFIG.assocStrings.activitySequencePredecessor, "", [], false);
}

function findVisibleSequenceElementAssociations(sourceElement, sequenceElement,
												sequenceAssocType, collectedComments, visitedElements,
												isSkippingElements) {
	var ret = [];
	
	var sequenceAssociations = sequenceElement.getAssociations(sequenceAssocType);
	
	for (var i = 0; i < sequenceAssociations.length; i++) {
		var sequenceAssociation = sequenceAssociations[i];
		var nextElement = sequenceAssociation.getTarget();
		
		var nextComment = getComment(sequenceAssociation);
		var opponentComment = getComment(reverseAssoc(sequenceAssociation))
		if(sequenceAssocType.indexOf("successor")!=-1){
			var tmpComment= nextComment;
			nextComment=opponentComment;
			opponentComment=tmpComment;
		}
		var copiedComments = collectedComments;
		switch (showTailoredCommentsMode) {
			case "all":
				if (nextComment != ""){
					copiedComments += (copiedComments.length > 0 ? " / " : "") + nextComment;
				}
				if(opponentComment!=""){
					copiedComments += (copiedComments.length > 0 ? " / " : "") + opponentComment;
				}
				break;
			case "first":
				if (sourceElement == sequenceElement)
					if(opponentComment!="" &amp;&amp; nextComment!=""){
						copiedComments = nextComment +  " / " + opponentComment ;
					}else{
						copiedComments = nextComment +  opponentComment ;
					}
				break;
			default:
				log.fatal("UNKNOWN MODE showTailoredCommentsMode: " + showTailoredCommentsMode);
				break;
		}
		
		//debug("findVisibleSequenceElementAssociations: found " + sequenceAssocType + " sequence from " + debugPE(sequenceElement) + " to " + debugPE(nextElement) + " with comment \"" + nextComment + "\", copiedComments="  + copiedComments);
		
		if (!isVisible(nextElement)) {
				if (visitedElements[getId(sequenceElement)] !== undefined)
				return [];
				visitedElements[getId(sequenceElement)] = true;
				ret = ret.concat(findVisibleSequenceElementAssociations(sourceElement, nextElement, sequenceAssocType, copiedComments, visitedElements, true));
				
		} else {
			// Do not draw an association onto itself unless it was a genuinly modeled one
			if (!isSkippingElements || getId(sourceElement) != getId(nextElement)) {
				var mockAssoc = createMockAssociation(sourceElement, nextElement, copiedComments);
				debug("findVisibleSequenceElementAssociations: CREATED sequence from " + debugPE(mockAssoc.getSource()) + " to " + debugPE(mockAssoc.getTarget()) + " with comment \"" + mockAssoc.getProperty("Comment") + "\", skipping=" + isSkippingElements);
				ret.push(mockAssoc);
			}
		}
	}
	return ret;
}

function getVirtualSequences(activity, outputAssocs, otherDirectionAssociationType, elementContainer) {
	var virtualSequences = [];
	for (var i = 0; i < outputAssocs.length; i++) {
		var output = outputAssocs[i].getTarget();
		// Make sure we don't have a description only element in our hands
		if (!isMockElement(output)) {
			var comment = getComment(outputAssocs[i]);
			if (isVisible(output)) {
				var virtualSequenceActivityAssocs = output.getAssociations(otherDirectionAssociationType);
				for (var j = 0; j < virtualSequenceActivityAssocs.length; j++) {
					var virtualSequenceActivity = virtualSequenceActivityAssocs[j].getTarget();
					var oppositeComment = getComment(reverseAssoc(virtualSequenceActivityAssocs[j]));
	//debug("virtualSequence between " + debugPE(activity) + " and " + debugPE(virtualSequenceActivity) + " through " + debugPE(output));
					if (getId(activity) != getId(virtualSequenceActivity) &amp;&amp;
						comment === oppositeComment &amp;&amp;
						elementContainer.containsElement(virtualSequenceActivity)) {
						var virtualSequence = createMockAssociation(activity, virtualSequenceActivity);
						//virtualSequence.setProperty("Comment", comment + "/" + oppositeComment)
						virtualSequences.push(virtualSequence);
					}
				}
			}
		}
	}
	return virtualSequences;
}

var createMockAssociation = function (e1, e2, c) {
	var mock = {
		getSource: function () { return e1; },
		getTarget: function () { return e2; },
		getProperty: function (p) { if (p == "Comment") return c; return "UNKNOWN PROPERTY: " + p; }
	};
	return mock;
}

function getAssociationTargets(associations) {
	var ret = [];
	for (var i = 0; i < associations.length; i++)
		ret.push(associations[i].getTarget());
	return ret;
}

function isStartActivity(element) {
	return "start" == getAttribute(element, "flowPosition");
}

var getAttribute = function (element, attributeName) {
    if (isMockElement(element)) {
        var realElement = element.getProperty("RealElement");
		if (realElement != undefined)
			element = realElement;
    }
    if (isAttributeValid(element, attributeName)) {
        var attribute = _unbox(element.getAttribute(attributeName).getProperty("databaseValue"));
        if (attribute === "" || attribute === null) {
            return undefined;
        }
        return attribute;
    }
    return undefined;
};
var isAttributeValid = function (element, attributeName) {
	if (!isMockElement(element)) {
		return _unbox(element.getPkitClass().isAttributeValid(attributeName));
	}
	else{
		return false;
	}
};
var isMockElement = function (e) {
    return (_unbox(e.getPkitClass().getName()) === "MockClass");
};

function _unbox(r) { return r; }

var getDisplayName = function (element) {return _unbox(element.getProperty("DisplayName"));};
var getType = function (element) {return _unbox(element.getProperty("Type"));};
var	getSubType = function (element) {return _unbox(element.getProperty("SubType"));};
var	getId = function (element) {return _unbox(element.getProperty("Id"));};
var getComment = function (assoc) {
	var comment = _unbox(assoc.getProperty("Comment"));
	if (comment === null)
		comment = "";
	return comment;
};
var reverseAssoc = function (assoc) {
	if (isCommentOnlyAssociation(assoc)) {
		// We found at least one DoE. Return a mocked reversed new assoc.
		return createMockAssociation(assoc.getTarget(), assoc.getSource(), "");
	}
    return assoc.getOpponentAssociation();
};
function isCommentOnlyAssociation(assoc) {
	return getId(assoc.getSource()) == 0 || getId(assoc.getTarget()) == 0;
}
function isVisible(element) {
    return element.getProperty("Visible");
}

/////////////////////////////////////Functions///////////////////////////////////////

	function debug(s) {
		return;  // comment out to start debugging
		dataset.setColumnValue("debug", s);
		dataset.storeResultRow();
	}

	function fatal(s) {
		debug("debug", "FATAL: " + s);
	}
	
	function exportActivityWithSubactivities(process, level) {
			exportActivity(process, level);
			exportSubactivities(process, level + 1);
	}
	
	function exportSubactivities(process, level) {
		var activities = getChildren(process);
		if (activities.length == 0)
			return;
		
		debug("exporting process " + process.getProperty("DisplayName") + " with " + activities.length + " activities");
		
		var sortedActivities = sortActivities(activities);
		for (var i = 0; i < sortedActivities.length; i++) {
			exportActivityWithSubactivities(sortedActivities[i], level);
		}
	}
	
	function sortActivities(activities) {
		return getActivityDependencyOrder(activities);
	}
	
	var sequenceCounter = 1;
	
	function exportActivity(activity, level) {
		debug("exporting activity " + activity.getProperty("DisplayName"));

		exportAttribute("ActivityName", activity, "DisplayName");
		exportAttribute("ActivityType", activity, "SubType");
		exportAssociatedAttribute("ResponsibleRoleName", activity, "responsible", "DisplayName");
		exportAssociatedAttribute("SupportingRoleName", activity, "support", "DisplayName");
		exportAssociatedAttribute("Inputs", activity, "input", "DisplayName");
		exportAssociatedAttribute("Outputs", activity, "output", "DisplayName");

		exportCustomAttribute("Duration", activity, "Duration", "1");
		
		dataset.setColumnValue("ActivityURL", generateURL(activity));

		dataset.setColumnValue("SequenceNumber", "" + sequenceCounter++);
		dataset.setColumnValue("ActivityLevel", level);
		exportAttribute("InternalId", activity, "Id");
		exportAssociatedAttribute("PredecessorIds", activity, "sequence,targetrole=successor", "Id", params["generateSinglePredecessor"]);
		dataset.storeResultRow();		
	}
	
	function exportAttribute(attributeName, element, propertyName) {
		dataset.setColumnValue(attributeName, element.getProperty(propertyName));		
	}
	
	function exportCustomAttribute(attributeName, element, propertyName, defaultValue) {
		dataset.setColumnValue(attributeName, defaultValue);
		if (element.getPkitClass().isAttributeValid(propertyName)) {
			var customAttribute = element.getAttribute(propertyName);
			if (customAttribute != null)
				dataset.setColumnValue(attributeName, customAttribute.getProperty("value"));
		}
	}
	
	function exportAssociatedAttribute(attributeName, element, associationName, propertyName, onlyLastOne) {
		var associatedElements = element.getEntities(associationName);
		if (onlyLastOne) {
			if (associatedElements.length > 0)
				dataset.setColumnValue(attributeName, associatedElements[associatedElements.length - 1].getProperty(propertyName));
		} else {
			var values = [];
			for (var i = 0; i < associatedElements.length; i++) {
				values.push(associatedElements[i].getProperty(propertyName));
			}
			dataset.setColumnValue(attributeName, values.join(";"));
		}
	}
	
	function getChildren(element) {
		return element.getEntities("hierarchy::hierarchic,targetrole=children");
	}

	function generateURL(element) {
		//return "URL";
		return element.getUrl();
	}
	
	/////////////////////////////////////Main Script///////////////////////////////////////

		var startProject = stages.getCurrentProject();
		var currentProcess = startProject.getEntities("containsProcess@SYSTEM")[0];

		debug("currentProcess=" + currentProcess);
		debug("currentProcessVersion=" + currentProcess.getProperty("Version"));
		
		var targetProcessList = params["processNames"].split("|");

		// DEBUG
		//targetProcessList.push("Software Design");
		
		var targetProcesses = [];
		debug("targetProcessList#=" + targetProcessList.length);
		for (var i = 0; i < targetProcessList.length; i++) {
			debug("targetProcess="  + targetProcessList[i]);
			targetProcesses[targetProcessList[i]] = 1;
		}

		var activityIndex = currentProcess.getEntities("containsActivityIndex@SYSTEM")[0];
		var toplevelProcesses = getChildren(activityIndex);
		for (var i = 0; i < toplevelProcesses.length; i++) {
			var toplevelProcess = toplevelProcesses[i];
			debug("checking process " + toplevelProcess.getProperty("DisplayName"));
			if (targetProcesses[toplevelProcess.getProperty("DisplayName")])
				exportActivityWithSubactivities(toplevelProcess, 0);
		}]]></xml-property>
            <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
  <Version>2.0</Version>
  <design:ResultSets derivedMetaData="false">
    <design:resultSetDefinitions>
      <design:resultSetColumns>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>ActivityName</design:name>
              <design:position>1</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>ActivityName</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>ResponsibleRoleName</design:name>
              <design:position>2</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>ResponsibleRoleName</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>Inputs</design:name>
              <design:position>3</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>Inputs</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>Outputs</design:name>
              <design:position>4</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>Outputs</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>SequenceNumber</design:name>
              <design:position>5</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>SequenceNumber</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>NextNumbers</design:name>
              <design:position>6</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>NextNumbers</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>ActivityURL</design:name>
              <design:position>7</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>-1</design:precision>
            <design:scale>-1</design:scale>
            <design:nullability>Unknown</design:nullability>
          </design:attributes>
          <design:usageHints>
            <design:label>ActivityURL</design:label>
            <design:formattingHints/>
          </design:usageHints>
        </design:resultColumnDefinitions>
      </design:resultSetColumns>
      <design:criteria/>
    </design:resultSetDefinitions>
  </design:ResultSets>
</model:DesignValues>]]></xml-property>
            <list-property name="privateDriverProperties">
                <ex-property>
                    <name>columnSet</name>
                    <value>debug:%:SequenceNumber:%:ActivityLevel:%:ActivityType:%:ActivityName:%:ResponsibleRoleName:%:SupportingRoleName:%:Inputs:%:Outputs:%:ActivityURL:%:InternalId:%:PredecessorIds:%:Duration</value>
                </ex-property>
                <ex-property>
                    <name>columnTypeSet</name>
                    <value>String:%:String:%:Integer:%:String:%:String:%:String:%:String:%:String:%:String:%:String:%:String:%:String:%:String</value>
                </ex-property>
                <ex-property>
                    <name>currentMetric</name>
                </ex-property>
                <ex-property>
                    <name>currentWorkspace</name>
                </ex-property>
                <ex-property>
                    <name>currentProcessVersion</name>
                </ex-property>
                <ex-property>
                    <name>currentFolder</name>
                </ex-property>
            </list-property>
        </oda-data-set>
    </data-sets>
    <styles>
        <style name="report" id="4">
            <property name="fontFamily">sans-serif</property>
            <property name="fontSize">10pt</property>
        </style>
        <style name="crosstab" id="5">
            <property name="borderBottomColor">#CCCCCC</property>
            <property name="borderBottomStyle">solid</property>
            <property name="borderBottomWidth">1pt</property>
            <property name="borderLeftColor">#CCCCCC</property>
            <property name="borderLeftStyle">solid</property>
            <property name="borderLeftWidth">1pt</property>
            <property name="borderRightColor">#CCCCCC</property>
            <property name="borderRightStyle">solid</property>
            <property name="borderRightWidth">1pt</property>
            <property name="borderTopColor">#CCCCCC</property>
            <property name="borderTopStyle">solid</property>
            <property name="borderTopWidth">1pt</property>
        </style>
        <style name="crosstab-cell" id="6">
            <property name="borderBottomColor">#CCCCCC</property>
            <property name="borderBottomStyle">solid</property>
            <property name="borderBottomWidth">1pt</property>
            <property name="borderLeftColor">#CCCCCC</property>
            <property name="borderLeftStyle">solid</property>
            <property name="borderLeftWidth">1pt</property>
            <property name="borderRightColor">#CCCCCC</property>
            <property name="borderRightStyle">solid</property>
            <property name="borderRightWidth">1pt</property>
            <property name="borderTopColor">#CCCCCC</property>
            <property name="borderTopStyle">solid</property>
            <property name="borderTopWidth">1pt</property>
        </style>
    </styles>
    <page-setup>
        <simple-master-page name="Simple MasterPage" id="2">
            <property name="type">custom</property>
            <property name="height">8.5in</property>
            <property name="width">15in</property>
            <page-footer>
                <text id="3">
                    <property name="contentType">html</property>
                    <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
                </text>
            </page-footer>
        </simple-master-page>
    </page-setup>
    <body>
        <table id="10">
            <property name="dataSet">Process Export Data Set</property>
            <list-property name="boundDataColumns">
                <structure>
                    <property name="name">ActivityName</property>
                    <text-property name="displayName">ActivityName</text-property>
                    <expression name="expression" type="javascript">dataSetRow["ActivityName"]</expression>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="name">ResponsibleRoleName</property>
                    <text-property name="displayName">ResponsibleRoleName</text-property>
                    <expression name="expression" type="javascript">dataSetRow["ResponsibleRoleName"]</expression>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="name">Inputs</property>
                    <text-property name="displayName">Inputs</text-property>
                    <expression name="expression" type="javascript">dataSetRow["Inputs"]</expression>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="name">Outputs</property>
                    <text-property name="displayName">Outputs</text-property>
                    <expression name="expression" type="javascript">dataSetRow["Outputs"]</expression>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="name">SequenceNumber</property>
                    <text-property name="displayName">SequenceNumber</text-property>
                    <expression name="expression" type="javascript">dataSetRow["SequenceNumber"]</expression>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="name">ActivityURL</property>
                    <text-property name="displayName">ActivityURL</text-property>
                    <expression name="expression" type="javascript">dataSetRow["ActivityURL"]</expression>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="name">ActivityLevel</property>
                    <text-property name="displayName">ActivityLevel</text-property>
                    <expression name="expression" type="javascript">dataSetRow["ActivityLevel"]</expression>
                    <property name="dataType">string</property>
                    <property name="allowExport">true</property>
                </structure>
                <structure>
                    <property name="name">ActivityType</property>
                    <text-property name="displayName">ActivityType</text-property>
                    <expression name="expression" type="javascript">dataSetRow["ActivityType"]</expression>
                    <property name="dataType">string</property>
                    <property name="allowExport">true</property>
                </structure>
                <structure>
                    <property name="name">SupportingRoleName</property>
                    <text-property name="displayName">SupportingRoleName</text-property>
                    <expression name="expression" type="javascript">dataSetRow["SupportingRoleName"]</expression>
                    <property name="dataType">string</property>
                    <property name="allowExport">true</property>
                </structure>
                <structure>
                    <property name="name">InternalId</property>
                    <text-property name="displayName">InternalId</text-property>
                    <expression name="expression" type="javascript">dataSetRow["InternalId"]</expression>
                    <property name="dataType">string</property>
                    <property name="allowExport">true</property>
                </structure>
                <structure>
                    <property name="name">PredecessorIds</property>
                    <text-property name="displayName">PredecessorIds</text-property>
                    <expression name="expression" type="javascript">dataSetRow["PredecessorIds"]</expression>
                    <property name="dataType">string</property>
                    <property name="allowExport">true</property>
                </structure>
                <structure>
                    <property name="name">Duration</property>
                    <text-property name="displayName">Duration</text-property>
                    <expression name="expression" type="javascript">dataSetRow["Duration"]</expression>
                    <property name="dataType">string</property>
                    <property name="allowExport">true</property>
                </structure>
            </list-property>
            <property name="repeatHeader">false</property>
            <property name="pageBreakInterval">0</property>
            <column id="79">
                <property name="repeat">1</property>
            </column>
            <column id="49">
                <property name="repeat">1</property>
            </column>
            <column id="99"/>
            <column id="89">
                <property name="repeat">1</property>
            </column>
            <column id="60">
                <property name="repeat">1</property>
            </column>
            <column id="50"/>
            <column id="72"/>
            <column id="51"/>
            <column id="52"/>
            <column id="55"/>
            <header>
                <row id="11">
                    <property name="backgroundColor">#0080C0</property>
                    <property name="fontWeight">normal</property>
                    <property name="color">#FFFFFF</property>
                    <property name="textAlign">left</property>
                    <cell id="80">
                        <label id="81">
                            <text-property name="text">Internal_ID</text-property>
                        </label>
                    </cell>
                    <cell id="12">
                        <label id="13">
                            <text-property name="text">Activity_Name</text-property>
                        </label>
                    </cell>
                    <cell id="97">
                        <label id="100">
                            <text-property name="text">Duration</text-property>
                        </label>
                    </cell>
                    <cell id="90">
                        <label id="91">
                            <text-property name="text">Predecessor_IDs</text-property>
                        </label>
                    </cell>
                    <cell id="57">
                        <label id="61">
                            <text-property name="text">Level</text-property>
                        </label>
                    </cell>
                    <cell id="14">
                        <label id="15">
                            <text-property name="text">Responsible_Role</text-property>
                        </label>
                    </cell>
                    <cell id="69">
                        <text id="73">
                            <property name="contentType">auto</property>
                            <text-property name="content"><![CDATA[Supporting_Role]]></text-property>
                        </text>
                    </cell>
                    <cell id="16">
                        <label id="17">
                            <text-property name="text">Inputs</text-property>
                        </label>
                    </cell>
                    <cell id="18">
                        <label id="19">
                            <text-property name="text">Outputs</text-property>
                        </label>
                    </cell>
                    <cell id="24">
                        <label id="25">
                            <text-property name="text">URL</text-property>
                        </label>
                    </cell>
                </row>
            </header>
            <detail>
                <row id="26">
                    <cell id="82">
                        <data id="95">
                            <property name="resultSetColumn">InternalId</property>
                        </data>
                    </cell>
                    <cell id="27">
                        <data id="28">
                            <property name="resultSetColumn">ActivityName</property>
                        </data>
                    </cell>
                    <cell id="98">
                        <data id="101">
                            <property name="resultSetColumn">Duration</property>
                        </data>
                    </cell>
                    <cell id="92">
                        <data id="96">
                            <property name="resultSetColumn">PredecessorIds</property>
                        </data>
                    </cell>
                    <cell id="58">
                        <data id="62">
                            <property name="resultSetColumn">ActivityLevel</property>
                        </data>
                    </cell>
                    <cell id="29">
                        <data id="30">
                            <property name="resultSetColumn">ResponsibleRoleName</property>
                        </data>
                    </cell>
                    <cell id="70">
                        <data id="74">
                            <property name="resultSetColumn">SupportingRoleName</property>
                        </data>
                    </cell>
                    <cell id="31">
                        <data id="32">
                            <property name="resultSetColumn">Inputs</property>
                        </data>
                    </cell>
                    <cell id="33">
                        <data id="34">
                            <property name="resultSetColumn">Outputs</property>
                        </data>
                    </cell>
                    <cell id="39">
                        <data id="40">
                            <property name="resultSetColumn">ActivityURL</property>
                        </data>
                    </cell>
                </row>
            </detail>
        </table>
    </body>
</report>
