dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
run_workflow_install.php
Go to the documentation of this file.
1<?php
8$base = dirname(__DIR__, 4);
9chdir($base);
10$_SERVER['REQUEST_URI'] = '/dbxapp/';
11$_SERVER['HTTP_HOST'] = 'localhost';
12$_SERVER['HTTPS'] = 'on';
13$_SERVER['SCRIPT_NAME'] = '/dbxapp/index.php';
14
15define('dbxSystem', 'dbxWebApp');
16define('dbxRunAsAdmin', 1);
17
18require $base . '/dbx/vendor/autoload.php';
19require_once $base . '/dbx/include/dbxKernel.php';
20
21$result = array('dds' => array(), 'seeded' => false, 'errors' => array());
22$oDD = dbx()->get_system_obj('dbxDD');
23
24foreach (array('workflowDefinition', 'workflowInstance', 'workflowStep', 'workflowModuleBind') as $dd) {
25 try {
26 $oDD->sync_dd_to_db('dbxWorkflow', $dd, 'reset');
27 $status = '';
28 for ($i = 0; $i < 80; $i++) {
29 $state = $oDD->sync_dd_to_db('dbxWorkflow', $dd, 'apply');
30 $status = (string) ($state['status'] ?? '');
31 if ($status === 'finished' || $status === 'error') break;
32 }
33 $result['dds'][$dd] = $status;
34 if ($status !== 'finished') {
35 $result['errors'][] = $dd . ': ' . ($status !== '' ? $status : 'kein Abschlussstatus');
36 }
37 } catch (Throwable $e) {
38 $result['errors'][] = $dd . ': ' . $e->getMessage();
39 }
40}
41
42if (!$result['errors']) {
43 dbx()->get_include_obj('dbxWorkflowEngine', 'dbxWorkflow')->seed_demo_definitions();
44 $result['seeded'] = true;
45}
46
47echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;
48exit($result['errors'] ? 1 : 0);
49
$_SERVER['REQUEST_METHOD']
exit
Definition index.php:146
DBX schema administration.