BrightSide Workbench Full Report + Source Code
org.turro.dossier.task.Tasks Class Reference

Public Member Functions

double getPercentTasksDone ()
 
Collection< TaskItemgetFilledFlat ()
 
Collection< TaskItemgetFilledRoots ()
 
Collection< TaskItemgetRoots ()
 
Collection< TaskItemgetSubtasks (TaskItem item)
 
Collection< TaskItemgetFlat (Collection< TaskItem > items)
 

Static Public Member Functions

static Tasks from (Dossier dossier, boolean onlyOpen, boolean sameDossier)
 
static Tasks from (Issue issue, boolean onlyOpen, boolean sameDossier)
 

Detailed Description

Member Function Documentation

◆ from() [1/2]

static Tasks org.turro.dossier.task.Tasks.from ( Dossier  dossier,
boolean  onlyOpen,
boolean  sameDossier 
)
static

Definition at line 119 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

119  {
120  return new Tasks(dossier, null, onlyOpen, sameDossier);
121  }
Here is the caller graph for this function:

◆ from() [2/2]

static Tasks org.turro.dossier.task.Tasks.from ( Issue  issue,
boolean  onlyOpen,
boolean  sameDossier 
)
static

Definition at line 123 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

123  {
124  return new Tasks(null, issue, onlyOpen, sameDossier);
125  }

◆ getFilledFlat()

Collection<TaskItem> org.turro.dossier.task.Tasks.getFilledFlat ( )

Definition at line 52 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFilledRoots()

Collection<TaskItem> org.turro.dossier.task.Tasks.getFilledRoots ( )

Definition at line 56 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

56  {
57  Collection<TaskItem> model = getRoots();
58  model.forEach((task) -> fillSubtasks(task));
59  return model;
60  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFlat()

Collection<TaskItem> org.turro.dossier.task.Tasks.getFlat ( Collection< TaskItem items)

Definition at line 95 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

95  {
96  FlatList list = new FlatList<TaskItem>() {
97  @Override
98  protected Collection<TaskItem> subItems(TaskItem item) {
99  return item.getSubtasks();
100  }
101  };
102  items.forEach((item) -> {
103  list.addItem(item);
104  });
105  return list;
106  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPercentTasksDone()

double org.turro.dossier.task.Tasks.getPercentTasksDone ( )

Definition at line 39 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

39  {
40  Collection<TaskItem> subtasks = getFilledFlat();
41 // if(issue != null) {
42 // subtasks.removeIf(ti -> Objects.equals(ti.getIssue().getId(), issue.getId()));
43 // }
44  if(subtasks.isEmpty()) {
45  return 0;
46  } else {
47  double done = subtasks.stream().filter(ti -> ti.getIssue().getStatus().isFinished()).count();
48  return (done / subtasks.size()) * 100.0;
49  }
50  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRoots()

Collection<TaskItem> org.turro.dossier.task.Tasks.getRoots ( )

Definition at line 62 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

62  {
63  if(issue != null) {
64  return List.<TaskItem>of(new TaskItem(issue, null, 1));
65  } else {
66  try(Stream<Issue> stream = SqlClause.select("i").from("Issue i")
67  .where().equal("i.dossier", dossier)
68  .startIf(onlyOpen)
69  .and().in("i.status", IssueStatus.selectBy(null, null, null, false))
70  .endIf()
71  .and().empty("i.targets")
72  .dao(dao)
73  .stream(Issue.class)) {
74  return stream.map(i -> new TaskItem(i, null, 1)).toList();
75  }
76  }
77  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSubtasks()

Collection<TaskItem> org.turro.dossier.task.Tasks.getSubtasks ( TaskItem  item)

Definition at line 79 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/task/Tasks.java.

79  {
80  try(Stream<IssuePredecessor> stream = SqlClause.select("p").from("IssuePredecessor p")
81  .where().equal("p.target", item.getIssue())
82  .startIf(onlyOpen)
83  .and().in("p.target.status", IssueStatus.selectBy(null, null, null, false))
84  .endIf()
85  .startIf(sameDossier)
86  .and("p.target.dossier = p.source.dossier")
87  .endIf()
88  .dao(dao)
89  .stream(IssuePredecessor.class)) {
90  return stream.map(p -> new TaskItem(p.getSource(), p.getType(), item.getLevel() + 1))
91  .toList();
92  }
93  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: