

package AOMCase;

import com.metamaxim.modelscope.callbacks.*;

public class WantLogIn extends Behaviour {

    public String getState() {
		//Login is wanted if there is at least one outstanding Assignment Request for this Employee
		Instance[] myAssignmentRequests = this.selectByRef("Assignment Request", "Internal Resource");
		boolean logInWanted = false;
		for (int i = 0; i < myAssignmentRequests.length; i++ ) {
			if (myAssignmentRequests[i].getState("Assignment Request").equals("outstanding")) {
				logInWanted = true;
				}
			}
		return logInWanted ? "log in wanted" : "log in not wanted";
		}

}

