@@ -19,18 +19,40 @@ Remember to add the following line to `config/bundles.php` (not required if Symf
1919CleverAge\UiProcessBundle\CleverAgeUiProcessBundle::class => ['all' => true],
2020```
2121
22- ## Import routes
22+ ## Configuration
23+
24+ ### Import routes
2325
2426``` yaml
2527ui-process-bundle :
2628 resource : ' @CleverAgeUiProcessBundle/src/Controller'
2729 type : attribute
2830` ` `
31+
32+ ### Doctrine ORM Configuration
33+
2934* Run doctrine migration
3035* Create a user using ` cleverage:ui-process:user-create` console.
3136
3237Now you can access UI Process via http://your-domain.com/process
3338
39+ # # Full configuration
40+
41+ ` ` ` yaml
42+ # config/packages/clever_age_ui_process.yaml
43+
44+ clever_age_ui_process:
45+ security:
46+ roles: ['ROLE_ADMIN'] # Roles displayed inside user edit form
47+ logs:
48+ store_in_database: true # enable/disable store log in database (log_record table)
49+ database_level: Debug (on dev env) or Info # min log level to store log record in database
50+ file_level: Debug (on dev env) or Info # min log level to store log record in file
51+ report_increment_level: Warning # min log level to increment process execution report
52+ design:
53+ logo_path: 'bundles/cleverageuiprocess/logo.jpg' # logo displayed in UI navigation toolbar
54+ ` ` `
55+
3456# # Features
3557
3658# ## Launch process via UI
@@ -51,17 +73,36 @@ That's all, now you can launch a process via http post request
5173
5274***Curl sample***
5375` ` ` bash
54- make bash
55- curl --location 'http://apache2/http/process/execute?code=demo.die' \
56- --header 'Authorization: Bearer 3da8409b5f5b640fb0c43d68e8ac8d23' \
57- --form 'input=@"/file.csv"' \
58- --form 'context[context_1]="FOO"' \
59- --form 'context[context_2]="BAR"'
76+ curl --location 'http://localhost/http/process/execute' \
77+ --header 'Authorization: Bearer myBearerToken' \
78+ --form 'code="demo.upload_and_run"' \
79+ --form 'input="/path/to/your/file.csv"' \
80+ --form 'context="{\" foo\" : \" bar\" , \" delimiter\" : \" ;\" }"'
6081` ` `
82+
83+ ` ` ` bash
84+ curl --location 'http://localhost/http/process/execute' \
85+ --header 'Content-Type: application/json' \
86+ --header 'Authorization: Bearer d641d254aed12733758a3a4247559868' \
87+ --header 'Cookie: PHPSESSID=m8l9s5sniknv1b0jb798f8sri7; main_auth_profile_token=2f3d24' \
88+ --data '{
89+ "code": "demo.die",
90+ "context": {"foo": "bar"}
91+ }'
92+ ` ` `
93+
94+ ` ` ` bash
95+ curl --location 'http://localhost/http/process/execute' \
96+ --header 'Authorization: Bearer myBearerToken' \
97+ --form 'code="demo.dummy"' \
98+ --form 'queue="false"'
99+ ` ` `
100+
61101* Query string code parameter must be a valid process code
62102* Header Authorization: Bearer is the previously generated token
63103* input could be string or file representation
64- * context you can pass multiple context values
104+ * you can pass multiple context values
105+ * queue define if the process should be queued (default) or directly run
65106
66107
67108# ## Scheduler
@@ -78,12 +119,12 @@ See more details about ***messenger:consume*** command in consume message sectio
78119# # Consume Messages
79120Symfony messenger is used in order to run process via UI or schedule process
80121
81- *To consume process launched via UI make sure the following command is running*
122+ * To consume process launched via UI make sure the following command is running*
82123` ` ` bash
83124bin/console messenger:consume execute_process
84125` ` `
85126
86- *To consume scheduled process make sure the following command is running*
127+ * To consume scheduled process make sure the following command is running*
87128` ` ` bash
88129bin/console messenger:consume scheduler_cron
89130` ` `
@@ -131,6 +172,18 @@ killasgroup=true
131172stopasgroup=true
132173```
133174
134- ## Reference
175+ ## Troubleshooting
176+
177+ ### PHP Fatal error: Allowed memory size of xxx bytes exhausted
178+
179+ When `store_in_database` option is set, with lower value of `database_level` option, the process may generate many LogRecord.
180+ On debug environment, profiling too much queries cause memory exhaustion. So, you can :
181+ - Set `doctrine.dbal.profiling_collect_backtrace: false`
182+ - Increase `memory_limit` in php.ini
183+ - Set `clever_age_ui_process.logs.store_in_database: false` or improve value of `clever_age_ui_process.logs.database_level`
184+ - Use `--no-debug` flag for `cleverage:process:execute`
185+
186+ ### {"message":"Missing auth token."} Response when launch process via http request
135187
136- _TODO_
188+ If you use apache2 webserver, `SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1` VirtualHost directive must be
189+ uncomment to "force Apache to pass the Authorization header to PHP: required for "basic_auth" under PHP-FPM and FastCGI"
0 commit comments