1<?php
2namespace ILIAS\UI\Component\Listing\Workflow;
3
4/**
5 * This is the interface for a workflow factory.
6 */
7interface Factory
8{
9
10    /**
11     * ---
12     * description:
13     *   purpose: >
14     *      A workflow step represents a single step in a sequence of steps.
15     *      The status of a step consists of two parts: its availability and its
16     *      outcome or result.
17     *      Possible variants of availability are "available", "not available"
18     *      and "not available anymore". The status "active" will be set by the workflow.
19     *      The status of a step is defined as "not started", "in progress",
20     *      "completed successfully" and "unsuccessfully completed".
21     *   composition: >
22     *     A workflow step consists of a label, a description and a marker
23     *     that indicates its availability and result.
24     *     If a step is available and carries an action, the label is rendered as shy-button.
25     *   effect: >
26     *     A Step MAY have an action; when clicked, the action is triggered.
27     *
28     * context:
29     *     - A Step MUST be used within a Workflow.
30     *
31     * ----
32     *
33     * @param string 	$label
34     * @param string 	$description
35     * @param null|string|Signal 	$action
36     * @return  \ILIAS\UI\Component\Listing\Workflow\Step
37     */
38    public function step($label, $description = '', $action = null);
39
40    /**
41     * ---
42     * description:
43     *   purpose: >
44     *      A linear workflow is the basic form of a workflow: the user
45     *      should tackle every step, one after the other.
46     *   composition: >
47     *     A linear workflow has a title and lists a sequence of steps.
48     *     If the user is currently working on a step, the step is marked as active.
49     *   effect: >
50     *     A Step MAY have an action; when clicked, the action is triggered.
51     *
52     * rules:
53     *   usage:
54     *       1: >
55     *         Use a Linear Worflow for a set of tasks that should be performed one
56     *         after the other and where there are no inter-dependencies other
57     *         than completeliness of the prior task.
58     *       2: >
59     *         You SHOULD NOT use Linear Workflow for workflows with forked pathes
60     *         due to user-decisions or calculations.
61     *       3: >
62     *         You SHOULD NOT use Linear Workflow for continous workflows;
63     *         a inear workflow MUST have a start- and and end-point.
64     *
65     * ----
66     *
67     * @param string 	$title
68     * @param Step[] 	$steps
69     * @return  \ILIAS\UI\Component\Listing\Workflow\Linear
70     */
71    public function linear($title, array $steps);
72}
73