ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
workflow.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3
20if ($_SERVER['argc'] < 4) {
21 die("Usage: workflow.php username password client\r\n");
22}
23
24chdir(dirname(__FILE__));
25chdir('../../');
26
27include_once './Services/Authentication/classes/class.ilAuthFactory.php';
28ilAuthFactory::setContext(ilAuthFactory::CONTEXT_CRON);
29
30
31$_COOKIE["ilClientId"] = $_SERVER['argv'][3];
32$_POST['username'] = $_SERVER['argv'][1];
33$_POST['password'] = $_SERVER['argv'][2];
34
35include_once './include/inc.header.php';
36
37echo "\r\n";
38echo "-------------------------------------------------------------------------------\r\n";
39echo "Executing tutorial workflow: ilPetriNetWorkflow1\r\n";
40echo "-------------------------------------------------------------------------------\r\n";
41require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow1.php';
42$workflow1 = new ilPetriNetWorkflow1();
43echo "\r\n\r\n\r\n\r\n\r\n";
44
45
46echo "\r\n";
47echo "-------------------------------------------------------------------------------\r\n";
48echo "Executing tutorial workflow: ilPetriNetWorkflow2\r\n";
49echo "-------------------------------------------------------------------------------\r\n";
50require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow2.php';
51$workflow2 = new ilPetriNetWorkflow2();
52echo "\r\n\r\n\r\n\r\n\r\n";
53
54
55echo "\r\n";
56echo "-------------------------------------------------------------------------------\r\n";
57echo "Executing tutorial workflow: ilPetriNetWorkflow3\r\n";
58echo "-------------------------------------------------------------------------------\r\n";
59require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow3.php';
60$workflow3 = new ilPetriNetWorkflow3();
61echo "\r\n\r\n\r\n\r\n\r\n";
62
63
64echo "\r\n";
65echo "-------------------------------------------------------------------------------\r\n";
66echo "Executing tutorial workflow: ilPetriNetWorkflow4\r\n";
67echo "-------------------------------------------------------------------------------\r\n";
68
69// Instantiate and configure:
70require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow4.php';
71$workflow4 = new ilPetriNetWorkflow4();
72
73// Start the workflow:
74$workflow4->startWorkflow();
75
76// Save the workflow to the database.
77require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
78ilWorkflowDbHelper::writeWorkflow($workflow4);
79
80// Remove this instance.
81unset($workflow4);
82
83
84// Now we send out the time_passed event.
85require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowUtils.php';
86#ilWorkflowUtils::handleTimePassedEvent();
87
88require_once './Services/WorkflowEngine/classes/class.ilWorkflowEngine.php';
90
91// Set up params for the event, the event-detector is listening for:
92$a_type = 'test';
93$a_content = 'pass_passed';
98
99$engine->processEvent(
100 $a_type,
106);
107
108echo "\r\n\r\n\r\n\r\n\r\n";
An exception for terminatinating execution or to throw for unit testing.
static setContext($a_context)
set context
ilWorkflowEngine is part of the petri net based workflow engine.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$workflow4
Definition: workflow.php:71
$workflow1
Definition: workflow.php:42
$_POST['username']
Definition: workflow.php:32
$_COOKIE["ilClientId"]
Definition: workflow.php:31
$a_content
Definition: workflow.php:93
$workflow2
Definition: workflow.php:51
$engine
Definition: workflow.php:89
$a_subject_type
Definition: workflow.php:94
$a_context_id
Definition: workflow.php:97
$a_type
Definition: workflow.php:92
$a_context_type
Definition: workflow.php:96
$workflow3
Definition: workflow.php:60
$a_subject_id
Definition: workflow.php:95