package controls; 

import org.apache.beehive.controls.api.bean.ControlExtension;
import org.apache.beehive.controls.api.events.EventSet;
import com.bea.control.TaskControl;
import org.apache.xmlbeans.XmlObject;
import java.util.Date;

/** 
 * @jc:task 
 */ 
@ControlExtension()
@com.bea.control.TaskAnnotations.TaskCreate(taskPlanId = @com.bea.control.TaskAnnotations.TaskPlanID(path = "/Worklist/Compatibility 8.1.x",
                                                                                                     version = 9.0f,
                                                                                                     worklistHostApplicationId = "worklist-ejbs-81x"),
                                            isControlLevelAnno = true)
public interface AppTaskControl extends TaskControl 
{ 
    /** 
    * @jc:task-create
    *   name="{name}"
    */ 
    @com.bea.control.TaskAnnotations.TaskCreate(name = "{name}",
                                                taskPlanId = @com.bea.control.TaskAnnotations.TaskPlanID(path = "/Worklist/Compatibility 8.1.x",
                                                                                                         version = 9.0f,
                                                                                                         worklistHostApplicationId = "worklist-ejbs-81x"))
    public String createTaskByName(String name);

    /**
     * @jc:task-assign
     * user="{users}"
     * group="{groups}"
     * algorithm="ToUsersAndGroups"
     */
    @com.bea.control.TaskAnnotations.TaskAssign81x(instructions = @com.bea.control.TaskAnnotations.AssignmentInstructions81x(users = "{users}",
                                                                                                                             groups = "{groups}",
                                                                                                                             algorithm = AssignmentInstructions81x.Algorithm.ToUsersAndGroups))
    public void assignTaskToUsersAndGroups(String[] users, String[] groups);

    /**
     * @jc:task-assign
     * user="{user}"
     * algorithm="ToUser"
     */
    @com.bea.control.TaskAnnotations.TaskAssign81x(instructions = @com.bea.control.TaskAnnotations.AssignmentInstructions81x(users = "{user}",
                                                                                                                             algorithm = AssignmentInstructions81x.Algorithm.ToUser))
    public void assignTaskToUser(String user);

    /**
     * @jc:task-assign
     * group="{group}"
     * algorithm="ToUserInGroup"
     */
    @com.bea.control.TaskAnnotations.TaskAssign81x(instructions = @com.bea.control.TaskAnnotations.AssignmentInstructions81x(groups = "{group}",
                                                                                                                             algorithm = AssignmentInstructions81x.Algorithm.ToUserInGroup))
    public void assignTaskToUserInGroup(String group);

    /**
     * @jc:task-update
     * request={xml}
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.request)
    },
                                                   request = "{xml}")
    public void setRequest(XmlObject xml);

    /**
     * @jc:task-update
     * response={xml}
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.response)
    },
                                                   response = "{xml}")
    public void setResponse(XmlObject xml);

    /**
     * @jc:task-update
     * comment={comment}
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.comment)
    },
                                                   comment = "{comment}")
    public void setComment(String comment);

    /**
     * @jc:task-update
     * priority={priority}
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.priority)
    },
                                                   priority = "{priority}")
    public void setPriority(Integer priority);

    /**
     * @jc:task-update
     * owner={owner}
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.owner)
    },
                                                   owner = "{owner}")
    public void setOwner(String owner);

    /**
     * @jc:task-update can-be-aborted="{aborted}" can-be-returned="{returned}" can-be-reassigned="{reassigned}"
     * 
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(canBeAborted = "{aborted}", 
                                                   canBeReturned = "{returned}", 
                                                   setFlags = {
                                                       @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                                                                             field = FieldName.canBeAborted),
                                                       @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                                                                             field = FieldName.canBeReturned),
                                                       @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                                                                             field = FieldName.canBeReassigned)
                                                   }, 
                                                   canBeReassigned = "{reassigned}")
    public void setPermissions(Boolean aborted, Boolean returned, Boolean reassigned);

    /**
     * @jc:task-update completion-due-date="{date}"
     * 
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.completionDueDate)
    },
                                                   completionDueDate = @com.bea.control.TaskAnnotations.DateTimeSpec(absoluteTime = "{date}"))
    public void setCompletionDueDate(Date date);

    /**
     * @jc:task-update completion-due-business-date={duration}
     * completion-calendar={calendarID}
     * 
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.completionDueDate)
    },
                                                   completionDueDate = @com.bea.control.TaskAnnotations.DateTimeSpec(businessTime = @com.bea.control.TaskAnnotations.BusinessTimeAnno(duration = "{duration}",
                                                                                                                                                                                      calendarName = "{calendarID}",
                                                                                                                                                                                      isUserCalendar = false)))
    public void setCompletionDueBusinessDate(String duration, String calendarID);

    /**
     * @jc:task-update claim-due-business-date={duration}
     * claim-calendar={calendarID}
     * 
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {
        @com.bea.control.TaskAnnotations.Flag(isSet = true,
                                              field = FieldName.claimDueDate)
    },
                                                   claimDueDate = @com.bea.control.TaskAnnotations.DateTimeSpec(businessTime = @com.bea.control.TaskAnnotations.BusinessTimeAnno(duration = "{duration}",
                                                                                                                                                                                 calendarName = "{calendarID}",
                                                                                                                                                                                 isUserCalendar = false)))
    public void setClaimDueBusinessDate(String duration, String calendarID);

    /**
     * @jc:task-update claim-due-business-date={duration}
     */
    @com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {@com.bea.control.TaskAnnotations.Flag(isSet=true,field=FieldName.claimDueDate)}, claimDueDate = @com.bea.control.TaskAnnotations.DateTimeSpec(businessTime = @com.bea.control.TaskAnnotations.BusinessTimeAnno(duration="{duration}")))
    public void setClaimDueBusinessDateSystemCalendar(String duration);

    /**
     * @jc:task-update completion-due-business-date={duration}
     */
	@com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {@com.bea.control.TaskAnnotations.Flag(isSet=true,field=FieldName.completionDueDate)}, completionDueDate = @com.bea.control.TaskAnnotations.DateTimeSpec(businessTime = @com.bea.control.TaskAnnotations.BusinessTimeAnno(duration="{duration}")))
    public void setCompletionDueBusinessDateSystemCalendar(String duration);

    /**
     * @jc:task-update claim-due-date="{date}"
     * 
     */
	@com.bea.control.TaskAnnotations.TaskUpdate81x(setFlags = {@com.bea.control.TaskAnnotations.Flag(isSet=true,field=FieldName.claimDueDate)}, claimDueDate = @com.bea.control.TaskAnnotations.DateTimeSpec(absoluteTime = "{date}"))
    public void setClaimDueDate(Date date);

    /** 
     * @jc:task-abort enabled="true"
     */
	@com.bea.control.TaskAnnotations.TaskAbort()
    public void abortTask();

    /** 
     * @jc:task-resume enabled="true"
     */
	@com.bea.control.TaskAnnotations.TaskResume()
    public void resumeTask();

    /** 
     * @jc:task-suspend enabled="true"
     */
	@com.bea.control.TaskAnnotations.TaskSuspend()
    public void suspendTask();

    /** 
     * @jc:task-get-request enabled="true"
     */
	@com.bea.control.TaskAnnotations.TaskGetRequest81x()
    public XmlObject getRequest();

    /** 
     * @jc:task-get-response enabled="true"
     */
	@com.bea.control.TaskAnnotations.TaskGetResponse81x()
    public XmlObject getResponse();

    /** 
     * @jc:task-get-property name="{name}"
     */
	@com.bea.control.TaskAnnotations.TaskGetProperties(propertyNames = "{name}")
    public String getProperty(String name);

    /** 
     * @jc:task-set-property name="{name}" value="{value}"
     */
	@com.bea.control.TaskAnnotations.TaskSetProperty81x(name = "{name}", value = "{value}")
    public void setProperty(String name, String value);

    /** 
     * @jc:task-remove-property name="{name}"
     */
	@com.bea.control.TaskAnnotations.TaskRemoveProperties81x(propertyNames = "{name}")
    public void removeProperty(String name);


	@EventSet()
    public interface Callback extends TaskControl.Callback {
       /** 
        * @jc:task-event event-type="complete" response="{response}"
        */ 
		@com.bea.control.TaskAnnotations.TaskEventAnno(eventType = com.bea.wli.worklist.api.events.data.TaskEvent.Type.COMPLETE, responseParamName = "{response}")
        void onTaskCompleted(XmlObject response);

        /** 
        * @jc:task-event event-type="abort" response="{response}"
        */ 
		@com.bea.control.TaskAnnotations.TaskEventAnno(eventType = com.bea.wli.worklist.api.events.data.TaskEvent.Type.ABORT, responseParamName = "{response}")
        void onTaskAborted(XmlObject response);

        /** 
        * @jc:task-event event-type="expire" time="{time}"
        */ 
		@com.bea.control.TaskAnnotations.TaskEventAnno(eventType = com.bea.wli.worklist.api.events.data.TaskEvent.Type.TASK_EXPIRE, timeParamName = "{time}")
        void onTaskOverdue(Date time);
    }
	public AppTaskControl create();
} 
