Skip to content
/ cufar Public

cufer - clouWay flagged attendance reviewer

Notifications You must be signed in to change notification settings

clouway/cufar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CuFAR

Clouway User Flagged Attendance Reviewer

Seen/unseen flags with many users.


Usage

Here is an example of how the library is used.

Suppose we have a task that is scheduled for completion and we are making changes to its schedule. A general workflow will look like:

/*
...
FlagService flagService = <new FlagService instance>
Task task = <new Task instance>
...
*/

// Create a flag instance
ChangeFlag taskScheduleFlag = new TaskScheduleFlag();

// Making changes to the schedule
flagService.addFlagChange(taskScheduleFlag, dateOfUpdate, task.getId());

// An attender(user or someone else) looks at the schedule
flagService.seeFlag(taskScheduleFlag, taskList, attender, dateBeforeUpdate);

// Apply the flag values to one or more tasks
flagService.applyFlags(attender, taskList, new TaskScheduleFlagApplier());

Configuration

Your change flags should implement the ChangeFlag interface and be annotated with the @FlagFor annotation, like so:

@FlagFor(target = "Task", flagName = "TaskSchedule")
class TaskScheduleFlag implements ChangeFlag<Task, Long> {
  @Override
  public Long getReferenceId(Task task) {
    return task.getId();
  }
}

Also you need a FlagApplier for each of your flags:

@ApplierForFlag(TaskScheduleFlag.class)
class TaskScheduleFlagApplier implements FlagApplier<Task, Long> {

  @Override
  public void apply(Task task, boolean flagSeen) {
    /* implementation for applying the flagSeen value to the task instance */
  }

  @Override
    public Long getReferenceId(Task task) {
      return task.getId();
    }
}

About

cufer - clouWay flagged attendance reviewer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages