@Override
  public Iterator<AssemblyTask> getAvailableTasks(User user) {
    IteratorConverter<WorkPost> converter = new IteratorConverter<>();
    HashMap<AssemblyTask, String> tasks = new HashMap<AssemblyTask, String>();

    for (AssemblyLine line : this.getOrderManager().getMainScheduler().getAssemblyLines())
      for (WorkPost post : converter.convert(line.getWorkPostsIterator()))
        for (AssemblyTask task : post.getResponsibleTasksClone())
          if (task.canBeOrdered())
            if (!tasks.containsValue(task.toString())) tasks.put(task, task.toString());

    return tasks.keySet().iterator();
  }
 @Override
 public Iterator<String> getAvailableAssemblyLineStatus(
     User user, AssemblyLine selectedAssemblyLine) throws NoClearanceException {
   if (user.canChangeOperationalStatus()) {
     return selectedAssemblyLine.getAllPossibleStates();
   } else {
     throw new NoClearanceException();
   }
 }
 @Override
 public String getCurrentAssemblyLineStatus(User user, AssemblyLine selectedAssemblyLine)
     throws NoClearanceException {
   if (user.canChangeOperationalStatus()) {
     return selectedAssemblyLine.currentState();
   } else {
     throw new NoClearanceException();
   }
 }
 public void changeAssemblyLineStatus(AssemblyLine assemblyLine, String status) {
   if (status.equalsIgnoreCase(assemblyLine.getBrokenState().toString()))
     assemblyLine.transitionToBroken();
   if (status.equalsIgnoreCase(assemblyLine.getMaintenanceState().toString()))
     assemblyLine.transitionToMaintenance();
   if (status.equalsIgnoreCase(assemblyLine.getOperationalState().toString()))
     assemblyLine.transitionToOperational();
 }
 @Override
 public Iterator<WorkPost> getWorkPosts(User user, AssemblyLine assemblyLine) {
   return assemblyLine.getWorkPostsIterator();
 }