ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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{
22 die("Usage: workflow.php username password client\r\n");
23}
24
25chdir(dirname(__FILE__));
26chdir('../../');
27
28include_once './Services/Authentication/classes/class.ilAuthFactory.php';
29ilAuthFactory::setContext(ilAuthFactory::CONTEXT_CRON);
30
31
32$_COOKIE["ilClientId"] = $_SERVER['argv'][3];
33$_POST['username'] = $_SERVER['argv'][1];
34$_POST['password'] = $_SERVER['argv'][2];
35
36include_once './include/inc.header.php';
37
38echo "\r\n";
39echo "-------------------------------------------------------------------------------\r\n";
40echo "Executing tutorial workflow: ilPetriNetWorkflow1\r\n";
41echo "-------------------------------------------------------------------------------\r\n";
42require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow1.php';
43$workflow1 = new ilPetriNetWorkflow1();
44echo "\r\n\r\n\r\n\r\n\r\n";
45
46
47echo "\r\n";
48echo "-------------------------------------------------------------------------------\r\n";
49echo "Executing tutorial workflow: ilPetriNetWorkflow2\r\n";
50echo "-------------------------------------------------------------------------------\r\n";
51require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow2.php';
52$workflow2 = new ilPetriNetWorkflow2();
53echo "\r\n\r\n\r\n\r\n\r\n";
54
55
56echo "\r\n";
57echo "-------------------------------------------------------------------------------\r\n";
58echo "Executing tutorial workflow: ilPetriNetWorkflow3\r\n";
59echo "-------------------------------------------------------------------------------\r\n";
60require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow3.php';
61$workflow3 = new ilPetriNetWorkflow3();
62echo "\r\n\r\n\r\n\r\n\r\n";
63
64
65echo "\r\n";
66echo "-------------------------------------------------------------------------------\r\n";
67echo "Executing tutorial workflow: ilPetriNetWorkflow4\r\n";
68echo "-------------------------------------------------------------------------------\r\n";
69
70// Instantiate and configure:
71require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow4.php';
72$workflow4 = new ilPetriNetWorkflow4();
73
74// Start the workflow:
75$workflow4->startWorkflow();
76
77// Save the workflow to the database.
78require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
79ilWorkflowDbHelper::writeWorkflow($workflow4);
80
81// Remove this instance.
82unset($workflow4);
83
84
85// Now we send out the time_passed event.
86require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowUtils.php';
87#ilWorkflowUtils::handleTimePassedEvent();
88
89require_once './Services/WorkflowEngine/classes/class.ilWorkflowEngine.php';
91
92// Set up params for the event, the event-detector is listening for:
93$a_type = 'test';
94$a_content = 'pass_passed';
99
100$engine->processEvent(
101 $a_type,
102 $a_content,
107);
108
109echo "\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.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$workflow4
Definition: workflow.php:72
$workflow1
Definition: workflow.php:43
$_POST['username']
Definition: workflow.php:33
$_COOKIE["ilClientId"]
Definition: workflow.php:32
$a_content
Definition: workflow.php:94
$workflow2
Definition: workflow.php:52
$engine
Definition: workflow.php:90
$a_subject_type
Definition: workflow.php:95
$a_context_id
Definition: workflow.php:98
$a_type
Definition: workflow.php:93
$a_context_type
Definition: workflow.php:97
$workflow3
Definition: workflow.php:61
$a_subject_id
Definition: workflow.php:96