private void gatherRootOutputs(LocationEnvironment rootEnvironment) {
		Helper.assertNull(this.workflowOutputs);
		Helper.assertNotEquals(ActivityInstanceState.Executing, this.rootInstance.getState());
		Helper.assertNotNull(rootEnvironment);

		if (this.rootInstance.getState() != ActivityInstanceState.Closed)
			return;

		List<RuntimeArgument> rootArguments = this.rootActivity.getRuntimeArguments();
		for (int i = 0; i < rootArguments.size(); i++) {
			RuntimeArgument argument = rootArguments.get(i);

			if (argument.getDirection() != ArgumentDirection.Out)
				continue;

			if (this.workflowOutputs == null)
				this.workflowOutputs = new HashMap<String, Object>();

			Location location = rootEnvironment.getLocation(argument.getId());
			Helper.assertNotNull(location);
			this.workflowOutputs.put(argument.getName(), location.getValue());
		}
	}