package org.museautomation.core.context;

import org.museautomation.core.*;
import org.museautomation.core.suite.*;

/**
 * @author Christopher L Merrill (see LICENSE.txt for license details)
 */
public class DefaultTaskExecutionContext extends BaseExecutionContext implements TaskExecutionContext
	{
	public DefaultTaskExecutionContext(MuseProject project, MuseTask test)
		{
		this(new ProjectExecutionContext(project), test);
		}

	public DefaultTaskExecutionContext(MuseExecutionContext parent_context, MuseTask test)
		{
		super(parent_context, ContextVariableScope.Execution);
		_task = test;
		}

	@Override
	public MuseTask getTask()
		{
		return _task;
		}

	@Override
	public String getTaskExecutionId()
		{
		if (_test_id == null)
			{
			TaskSuiteExecutionContext suite_context = MuseExecutionContext.findAncestor(this, TaskSuiteExecutionContext.class);
			if (suite_context != null)
				_test_id = suite_context.getTaskExecutionId(this);
			else
				_test_id = Long.toString(System.currentTimeMillis());
			}
		return _test_id;
		}

	protected final MuseTask _task;
	private String _test_id;
	}

@@ -69,16 +69,57 @@
 core.*;%0A
+import org.museautomation.core.output.*;%0A
 import o
@@ -394,35 +394,35 @@
 ject, MuseTask t
-est
+ask
 )%0A%09%09%7B%0A%09%09this(new
@@ -457,19 +457,19 @@
 ject), t
-est
+ask
 );%0A%09%09%7D%0A%0A
@@ -551,19 +551,19 @@
 seTask t
-est
+ask
 )%0A%09%09%7B%0A%09%09
@@ -628,19 +628,56 @@
 task = t
-est
+ask;%0A%09%09_outputs = new ExecutionOutputs()
 ;%0A%09%09%7D%0A%0A%09
@@ -797,19 +797,19 @@
 %09%09if (_t
-est
+ask
 _id == n
@@ -969,27 +969,27 @@
 null)%0A%09%09%09%09_t
-est
+ask
 _id = suite_
@@ -1036,19 +1036,19 @@
 e%0A%09%09%09%09_t
-est
+ask
 _id = Lo
@@ -1104,19 +1104,19 @@
 eturn _t
-est
+ask
 _id;%0A%09%09%7D
@@ -1117,17 +1117,20 @@
 d;%0A%09%09%7D%0A%0A
-%09
+    
 protecte
@@ -1171,19 +1171,19 @@
 tring _t
-est
+ask
 _id;%0A%09%7D%0A

test > task renaming