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.

ParameterDescription
parametersthe parameter values to add or replace, keyed by parameter name
projectthe 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.

ParameterDescription
namethe parameter name
valuethe parameter value
projectthe 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.

ParameterDescription
projectthe 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.

ParameterDescription
idthe identifier to assign to the task
projectNamethe name of the project the task belongs to
taskTitlethe task's display title
taskDescriptionthe 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.

ParameterDescription
namethe 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.

ParameterDescription
projectNamethe 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.

ParameterDescription
idthe 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.

ParameterDescription
projectNamethe 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.

ParameterDescription
namethe name to give the new project, used as its directory name
titlethe project's display title
recipeNamethe 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.

ParameterDescription
taskthe 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.

ParameterDescription
projectNamethe name of the project the task belongs to
taskNamethe name of the task to check

getProjectSettings(String name)

Returns: Map<String,Serializable>

Returns all settings for the given project

ParameterDescription
namethe project name as a {@code String}
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.