package li.strolch.execution.policy;

import li.strolch.agent.api.ComponentContainer;
import li.strolch.model.activity.Activity;
import li.strolch.persistence.api.StrolchTransaction;

public class RemoveActivityArchival extends ActivityArchivalPolicy {

	public RemoveActivityArchival(ComponentContainer container, StrolchTransaction tx) {
		super(container, tx);
	}

	@Override
	public void archive(Activity activity) {

		if (!activity.getState().isExecuted())
			throw new IllegalStateException("Can not archive non-executed " + activity.getLocator());

		tx().remove(activity);

		logger.info("Removing " + activity.getLocator());
	}
}

@@ -454,16 +454,51 @@
 ecuted()
+ && !activity.getState().isClosed()
 )%0A%09%09%09thr

Allow to archive activities in state CLOSED