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