ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
20 if ($_SERVER['argc'] < 4) {
21  die("Usage: workflow.php username password client\r\n");
22 }
23 
24 chdir(dirname(__FILE__));
25 chdir('../../');
26 
27 include_once './Services/Authentication/classes/class.ilAuthFactory.php';
28 ilAuthFactory::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 
35 include_once './include/inc.header.php';
36 
37 echo "\r\n";
38 echo "-------------------------------------------------------------------------------\r\n";
39 echo "Executing tutorial workflow: ilPetriNetWorkflow1\r\n";
40 echo "-------------------------------------------------------------------------------\r\n";
41 require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow1.php';
42 $workflow1 = new ilPetriNetWorkflow1();
43 echo "\r\n\r\n\r\n\r\n\r\n";
44 
45 
46 echo "\r\n";
47 echo "-------------------------------------------------------------------------------\r\n";
48 echo "Executing tutorial workflow: ilPetriNetWorkflow2\r\n";
49 echo "-------------------------------------------------------------------------------\r\n";
50 require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow2.php';
51 $workflow2 = new ilPetriNetWorkflow2();
52 echo "\r\n\r\n\r\n\r\n\r\n";
53 
54 
55 echo "\r\n";
56 echo "-------------------------------------------------------------------------------\r\n";
57 echo "Executing tutorial workflow: ilPetriNetWorkflow3\r\n";
58 echo "-------------------------------------------------------------------------------\r\n";
59 require_once './Services/WorkflowEngine/classes/tutorial/class.ilPetriNetWorkflow3.php';
60 $workflow3 = new ilPetriNetWorkflow3();
61 echo "\r\n\r\n\r\n\r\n\r\n";
62 
63 
64 echo "\r\n";
65 echo "-------------------------------------------------------------------------------\r\n";
66 echo "Executing tutorial workflow: ilPetriNetWorkflow4\r\n";
67 echo "-------------------------------------------------------------------------------\r\n";
68 
69 // Instantiate and configure:
70 require_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.
77 require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
78 ilWorkflowDbHelper::writeWorkflow($workflow4);
79 
80 // Remove this instance.
81 unset($workflow4);
82 
83 
84 // Now we send out the time_passed event.
85 require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowUtils.php';
86 #ilWorkflowUtils::handleTimePassedEvent();
87 
88 require_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,
101  $a_content,
106 );
107 
108 echo "\r\n\r\n\r\n\r\n\r\n";
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$workflow4
Definition: workflow.php:71
$a_subject_type
Definition: workflow.php:94
$engine
Definition: workflow.php:89
$a_context_id
Definition: workflow.php:97
$a_type
Definition: workflow.php:92
ilWorkflowEngine is part of the petri net based workflow engine.
$a_content
Definition: workflow.php:93
$_COOKIE["ilClientId"]
Definition: workflow.php:31
static setContext($a_context)
set context
$workflow3
Definition: workflow.php:60
$a_context_type
Definition: workflow.php:96
$a_subject_id
Definition: workflow.php:95
$_POST['username']
Definition: workflow.php:32
$workflow1
Definition: workflow.php:42
$workflow2
Definition: workflow.php:51