package controls;

import com.bea.control.TaskControl;



import org.apache.beehive.controls.api.bean.ControlExtension;
import org.apache.beehive.controls.api.events.EventSet;
import com.bea.wli.worklist.api.events.data.TaskEvent;

    @ControlExtension
public interface AppTaskControlII extends com.bea.control.TaskControl {

	public enum Step {
		ApplicationApproved, ApplicationRejected, ApprovalPending
	}

	@TaskGetCurrentStepEnum
	Step getCurrentStep();

	@TaskCreate(taskPlanId = @TaskPlanID(path = "/TASK-PLANS/application-task-plan", version = 1.0f), constructorName = "NewExternalApplication", name = "{taskName}", initialPropertyValues = { @PropertyValue(name = "ApplicationInfo", value = "{ApplicationInfo}") })
	@TaskGetStepInterface
	ApprovalPending NewExternalApplication(
			String taskName,
			org.openuri.temp.exampleApp.application.InternalApplicationDocument ApplicationInfo);

	@TaskGetProperties(propertyNames = "ApplicationCaseId")
	String getApplicationCaseId();

	@TaskSetProperties(propertyValues = { @PropertyValue(name = "ApplicationCaseId", value = "{value}") })
	void setApplicationCaseId(String value);

	@TaskGetProperties(propertyNames = "ApplicationInfo")
	org.openuri.temp.exampleApp.application.InternalApplicationDocument getApplicationInfo();

	@TaskSetProperties(propertyValues = { @PropertyValue(name = "ApplicationInfo", value = "{value}") })
	void setApplicationInfo(
			org.openuri.temp.exampleApp.application.InternalApplicationDocument value);

	@TaskGetStepInterface(stepName = "ApplicationApproved")
	ApplicationApproved getApplicationApprovedStep();

	@TaskGetStepInterface(stepName = "ApplicationRejected")
	ApplicationRejected getApplicationRejectedStep();

	@TaskGetStepInterface(stepName = "ApprovalPending")
	ApprovalPending getApprovalPendingStep();

	public interface ApplicationApproved {

		TaskControl getTaskControl();
	}

	public interface ApplicationRejected {

		TaskControl getTaskControl();
	}

	public interface ApprovalPending {

		TaskControl getTaskControl();

		@TaskTakeAction(name = "Approve", propertyValues = {
				@PropertyValue(name = "ApplicationCaseId", value = "{0}"),
				@PropertyValue(name = "ApplicationInfo", value = "{1}") })
		@TaskGetStepInterface
		ApplicationApproved Approve(
				String ApplicationCaseId,
				org.openuri.temp.exampleApp.application.InternalApplicationDocument ApplicationInfo);

		@TaskTakeAction(name = "Reject", propertyValues = { @PropertyValue(name = "ApplicationInfo", value = "{0}") })
		@TaskGetStepInterface
		ApplicationRejected Reject(
				org.openuri.temp.exampleApp.application.InternalApplicationDocument ApplicationInfo);
	}

	@EventSet
	public interface CustomCallback extends Callback {

		@TaskEventAnno(eventType = TaskEvent.Type.STEP_CHANGE, stepName = "ApplicationApproved", stepInnerInterfaceParamName = "step")
		void onApplicationApprovedStep(ApplicationApproved step);

		@TaskEventAnno(eventType = TaskEvent.Type.STEP_CHANGE, stepName = "ApplicationRejected", stepInnerInterfaceParamName = "step")
		void onApplicationRejectedStep(ApplicationRejected step);

		@TaskEventAnno(eventType = TaskEvent.Type.STEP_CHANGE, stepName = "ApprovalPending", stepInnerInterfaceParamName = "step")
		void onApprovalPendingStep(ApprovalPending step);
	}

	static final long serialVersionUID = 1;

	public AppTaskControlII create();
}