/**
 * IncrementCounterAction.java
 * Created on Aug 8, 2008
 * (C) Copyright TANDBERG Television Ltd.
 */
package com.tandbergtv.watchpoint.pmm.action.asset.distribution.mediapath;

import org.apache.log4j.Logger;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;

/**
 * @author Vlada Jakobac
 *
 */
public class IncrementCounterAction implements ActionHandler {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final Logger logger = Logger.getLogger(IncrementCounterAction.class);

	/* (non-Javadoc)
	 * @see org.jbpm.graph.def.ActionHandler#execute(org.jbpm.graph.exe.ExecutionContext)
	 */
	public void execute(ExecutionContext ec) throws Exception {
		Integer counter = (Integer) ec.getVariable(AssetDistributionVariables.COUNTER.toString());
		ec.setVariable(AssetDistributionVariables.COUNTER.toString(), (++counter));
		logger.debug("Current counter value: " + counter);  

	}

}
