Owns the lifecycle of app recipes: starting a recipe for a new account and progressing it as project tasks are completed. Starting a recipe (via startRecipe) creates a Project and enters the recipe's first step, which typically creates a Task for the account admin. As each task is completed, completeTaskWithOutcome runs the outcome's process function, closes the task and enters the next configured step, driving the account through the recipe's stages.
Group: Managers
Properties
| Property | Returns | Description |
|---|---|---|
| projectManager | ProjectManager | The project manager used to create and query the projects that recipes run within. |
Methods
percentComplete(Project project)
Returns: Integer
Calculates how far a project has progressed through its recipe, as a percentage of task steps completed.
| Parameter | Description |
|---|---|
project | the project to check, may be null |
startRecipe(RepositoryApp app, String projectTitle)
Returns: String
Starts the given app's recipe for the current account: creates a new Project and enters the recipe's first step, typically creating the first task for the account admin to complete.
| Parameter | Description |
|---|---|
app | the app whose recipe should be started; must declare a recipe with at least one step |
projectTitle | the title to give the new project, used as-is |
findRecipe(String recipeName)
Returns: Recipe
Looks up the recipe declared by the currently active app with the given name.
| Parameter | Description |
|---|---|
recipeName | the app instance id that provides the recipe |
completeTaskWithOutcome(Task task, String outcomeId, FormContext form)
Returns: JsonResult
Marks the given task as complete and, if an outcome was selected, runs the outcome's process function and enters its configured next step. Fails with a validation message if the task's step has outcomes but none was selected.
| Parameter | Description |
|---|---|
task | the task being completed, identifying the recipe step and project |
outcomeId | the id of the selected outcome, or null/blank if the step has no outcomes |
form | the submitted form data passed through to the outcome's process function |
getProjectManager()
Returns: ProjectManager
The project manager used to create and query the projects that recipes run within.