37 switch(strtolower($command))
56 return $this->startProcess();
63 case 'startlistening':
64 return $this->startListening();
83 require_once
'./Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDefinitionsTableGUI.php';
85 $table_gui->setFilterCommand(
"definitions.applyfilter");
86 $table_gui->setResetCommand(
"definitions.resetFilter");
87 $table_gui->setDisableFilterHiding(
false);
89 return $table_gui->getHTML();
97 require_once
'./Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDefinitionsTableGUI.php';
99 $table_gui->writeFilterToSession();
100 $table_gui->resetOffset();
110 require_once
'./Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDefinitionsTableGUI.php';
112 $table_gui->resetOffset();
113 $table_gui->resetFilter();
123 require_once
'./Services/WorkflowEngine/classes/administration/class.ilUploadDefinitionForm.php';
125 $form = $form_definition->getForm(
126 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.upload')
129 return $form->getHTML();
140 require_once
'./Services/WorkflowEngine/classes/administration/class.ilUploadDefinitionForm.php';
142 $form = $form_definition->getForm(
143 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.upload')
146 if(!$form->checkInput())
148 $form->setValuesByPost();
149 return $form->getHTML();
153 if(!is_dir($repo_dir_name))
159 if(!is_dir($temp_dir_name))
164 $file_name = $_FILES[
'process_file'][
'name'];
165 $temp_name = $_FILES[
'process_file'][
'tmp_name'];
169 $temp_dir_name . $file_name
172 $repo_base_name =
'il'.substr($file_name,0,strpos($file_name,
'.'));
173 $wf_base_name =
'wfd.'.$repo_base_name.
'_v';
175 if ($handle = opendir($repo_dir_name))
177 while (
false !== (
$file = readdir($handle)))
179 if(substr(strtolower(
$file), 0, strlen($wf_base_name)) == strtolower($wf_base_name)
180 && substr(
$file, -4) ==
'.php')
182 $number = substr(
$file, strlen($wf_base_name), -4);
193 $repo_name = $repo_base_name.
'_v'.
$version.
'.php';
196 require_once
'./Services/WorkflowEngine/classes/parser/class.ilBPMN2Parser.php';
198 $bpmn = file_get_contents($temp_dir_name.$file_name);
201 file_put_contents($repo_dir_name.
'wfd.'.$repo_name,
$code);
202 file_put_contents($repo_dir_name.
'wfd.'.$repo_base_name.
'_v'.
$version.
'.bpmn2', $bpmn);
203 unlink($temp_dir_name.$file_name);
207 html_entity_decode($this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.view'))
216 require_once
'./Services/UIComponent/Button/classes/class.ilLinkButton.php';
218 $upload_wizard_button->setCaption($this->parent_gui->lng->txt(
'upload_process'),
false);
219 $upload_wizard_button->setUrl(
220 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.uploadform')
222 $this->parent_gui->ilToolbar->addButtonInstance($upload_wizard_button);
230 if (isset(
$_POST[
'cmd'][
'cancel'])) {
234 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.view')
243 public function startListening()
245 $identifier = basename(
$_GET[
'process_id']);
248 $class = substr($identifier,4);
250 $workflow_instance =
new $class;
252 $workflow_instance->setWorkflowClass(
'wfd.'.$class.
'.php');
255 $show_armer_form =
true;
258 case isset(
$_POST[
'process_id']):
259 case isset(
$_POST[
'se_type']):
260 case isset(
$_POST[
'se_content']):
261 case isset(
$_POST[
'se_subject_type']):
262 case isset(
$_POST[
'se_context_type']):
263 $show_armer_form =
false;
266 $show_armer_form =
true;
270 require_once
'./Services/WorkflowEngine/classes/administration/class.ilWorkflowArmerGUI.php';
271 $this->parent_gui->ilCtrl->saveParameter($this->parent_gui,
'process_id', $identifier);
272 $action = $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.start');
275 $form = $armer->getForm($workflow_instance->getInputVars(), $workflow_instance->getStartEventInfo());
279 return $form->getHTML();
283 'type' => stripslashes(
$_POST[
'se_type']),
284 'content' => stripslashes(
$_POST[
'se_content']),
285 'subject_type' => stripslashes(
$_POST[
'se_subject_type']),
286 'subject_id' => (
int)
$_POST[
'se_subject_id'],
287 'context_type' => stripslashes($_POST[
'se_context_type']),
288 'context_id' => (
int)$_POST[
'se_context_id']
290 $process_id = stripslashes($_POST[
'process_id']);
292 require_once
'./Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
293 $event_id = ilWorkflowDbHelper::writeStartEventData($event_data, $process_id);
295 foreach($workflow_instance->getInputVars() as $input_var)
297 ilWorkflowDbHelper::writeStaticInput($input_var[
'name'], stripslashes($_POST[$input_var[
'name']]), $event_id);
303 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.view')
312 require_once
'./Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
313 ilWorkflowDbHelper::deleteStartEventData($process_id);
318 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.view')
328 public function startProcess()
330 if(isset(
$_POST[
'cmd'][
'cancel']))
335 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.view')
340 $identifier = basename(
$_GET[
'process_id']);
343 $class = substr($identifier,4);
345 $workflow_instance =
new $class;
347 $workflow_instance->setWorkflowClass(
'wfd.'.$class.
'.php');
350 if(count($workflow_instance->getInputVars()))
352 $show_launcher_form =
false;
353 foreach($workflow_instance->getInputVars() as $input_var)
355 if(!isset(
$_POST[$input_var[
'name']]))
357 $show_launcher_form =
true;
359 $workflow_instance->setInstanceVarById($input_var[
'name'],
$_POST[$input_var[
'name']]);
363 require_once
'./Services/WorkflowEngine/classes/administration/class.ilWorkflowLauncherGUI.php';
364 $this->parent_gui->ilCtrl->saveParameter($this->parent_gui,
'process_id', $identifier);
365 $action = $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.start');
367 $form = $launcher->getForm($workflow_instance->getInputVars());
369 if($show_launcher_form || $form->checkInput() ==
false)
371 $form->setValuesByPost();
372 return $form->getHTML();
376 require_once
'./Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
377 ilWorkflowDbHelper::writeWorkflow( $workflow_instance );
379 $workflow_instance->startWorkflow();
380 $workflow_instance->handleEvent(
391 ilWorkflowDbHelper::writeWorkflow( $workflow_instance );
396 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.view')
412 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui,
'definitions.view')
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
processUploadFormCancellation()
Class ilWorkflowEngineDefinitionsGUI.
__construct(ilObjWorkflowEngineGUI $parent_gui)
ilWorkflowEngineDefinitionsGUI constructor.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static getRepositoryDir()
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
handle($command)
Handle the command given.
static redirect($a_script)
http redirect to other script