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

PropertyReturnsDescription
projectManagerProjectManagerThe 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.

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

ParameterDescription
appthe app whose recipe should be started; must declare a recipe with at least one step
projectTitlethe 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.

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

ParameterDescription
taskthe task being completed, identifying the recipe step and project
outcomeIdthe id of the selected outcome, or null/blank if the step has no outcomes
formthe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.