Manages projects, which are running instances of task recipes such as setup wizards or onboarding checklists, together with the tasks that make up their steps. Projects are stored as project.xml files under a dedicated "_projects" repository in the current organisation, and the list of projects for an organisation is cached against the repository's content hash. Reached from JS via the registered service name "projectManager".
Group: Managers
Methods
saveProjectSettings(Map<String,Serializable> parameters, Project project) · addOrUpdateProjectSetting(String name, Serializable value, Project project) · saveProject(Project project) · createTask(String id, String projectName, String taskTitle, String taskDescription) · findProjects() · findProject(String name) · findTasksForProject(String projectName) · findTaskById(long id) · findActiveTasksForProject(String projectName) · createProject(String name, String title, String recipeName) · closeTask(Task task) · isTaskComplete(String projectName, String taskName) · getProjectSettings(String name)
saveProjectSettings(Map<String,Serializable> parameters, Project project)
Returns: Project
Adds the given parameters to the project, replacing any existing parameters with the same name. Existing parameters not present in the new map are left unchanged. The updated project is then saved to the projects repository.
| Parameter | Description |
|---|---|
parameters | the parameter values to add or replace, keyed by parameter name |
project | the project to update |
addOrUpdateProjectSetting(String name, Serializable value, Project project)
Returns: Project
Adds or replaces a single parameter on the project. Unlike saveProjectSettings, this does not save the result to the projects repository, so the caller is responsible for persisting the returned project.
| Parameter | Description |
|---|---|
name | the parameter name |
value | the parameter value |
project | the project to update |
saveProject(Project project)
Returns: void
Saves a project to the current organisation's projects repository, creating the repository and the project's directory if they do not already exist. The project is serialised to project.xml under a directory named after the project.
| Parameter | Description |
|---|---|
project | the project to save |
createTask(String id, String projectName, String taskTitle, String taskDescription)
Returns: Task
Creates and persists a new task for the given project in the current organisation.
| Parameter | Description |
|---|---|
id | the identifier to assign to the task |
projectName | the name of the project the task belongs to |
taskTitle | the task's display title |
taskDescription | the task's description |
findProjects()
Returns: List<Project>
Finds all projects stored in the current organisation's projects repository. Results are cached against the hash of the repository's live branch head, so this is cheap to call repeatedly while the repository content is unchanged, and involves I/O and XML parsing when the cache must be refreshed.
findProject(String name)
Returns: Project
Finds a single project in the current organisation by name. This iterates over findProjects, so it carries the same caching behaviour and cost.
| Parameter | Description |
|---|---|
name | the project name to look for |
findTasksForProject(String projectName)
Returns: List<Task>
Finds all tasks belonging to the given project in the current organisation, including completed ones.
| Parameter | Description |
|---|---|
projectName | the name of the project to find tasks for |
findTaskById(long id)
Returns: Task
Finds a single task by its database id within the current organisation.
| Parameter | Description |
|---|---|
id | the task's database id |
findActiveTasksForProject(String projectName)
Returns: List<Task>
Finds the tasks belonging to the given project in the current organisation that have not yet been closed.
| Parameter | Description |
|---|---|
projectName | the name of the project to find active tasks for |
createProject(String name, String title, String recipeName)
Returns: Project
Creates and saves a new project in the current organisation, built from the given recipe. The project is stored as project.xml under a new directory named after the project in the organisation's projects repository, creating that repository if it does not already exist.
| Parameter | Description |
|---|---|
name | the name to give the new project, used as its directory name |
title | the project's display title |
recipeName | the name of the recipe the project is created from |
closeTask(Task task)
Returns: void
Closes the given task, recording the current time as its completion date.
| Parameter | Description |
|---|---|
task | the task to close |
isTaskComplete(String projectName, String taskName)
Returns: boolean
Checks whether a named task within a project has been completed. A task is considered complete when at least one task with the given name has a completed date, and none of the tasks with that name are still incomplete.
| Parameter | Description |
|---|---|
projectName | the name of the project the task belongs to |
taskName | the name of the task to check |
getProjectSettings(String name)
Returns: Map<String,Serializable>
Returns all settings for the given project
| Parameter | Description |
|---|---|
name | the project name as a {@code String} |