Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By Vysakh
#825623
Hi,

Can anyone tell me what is the purpose of these queries in Processmaker ?

1.
SELECT
COUNT(DISTINCT APP_CACHE_VIEW.APP_UID)
FROM
APP_CACHE_VIEW
LEFT JOIN TASK ON
(APP_CACHE_VIEW.TAS_UID = TASK.TAS_UID)
WHERE
APP_CACHE_VIEW.APP_STATUS = 'COMPLETED'
AND APP_CACHE_VIEW.USR_UID = '74986913257bad3f69426f1028602054'
AND TASK.TAS_TYPE NOT IN ('WEBENTRYEVENT',
'END-MESSAGE-EVENT',
'START-MESSAGE-EVENT',
'INTERMEDIATE-THROW-MESSAGE-EVENT',
'INTERMEDIATE-CATCH-MESSAGE-EVENT')

2.
SELECT
RBAC_SYSTEMS.SYS_UID,
RBAC_SYSTEMS.SYS_CODE,
RBAC_SYSTEMS.SYS_CREATE_DATE,
RBAC_SYSTEMS.SYS_UPDATE_DATE,
RBAC_SYSTEMS.SYS_STATUS
FROM
RBAC_SYSTEMS
WHERE
RBAC_SYSTEMS.SYS_CODE = 'PROCESSMAKER'

These queries are running in background even if there is no connection to the server can anyone tell me why, and is there any option to kill these queries when connection is 0.
User avatar
By amosbatto
#825630
Are you sure that those queries aren't being executed by one of ProcessMaker's cron scripts set to execute periodically as a Windows Scheduled Task or a Linux cron job?

The first query checks how many completed cases there are for the user '74986913257bad3f69426f1028602054'. The second one looks up information about the ProcessMaker application in the database.
By Vysakh
#825677
Hi Sir,

We did not set any cron scripts, could you tell how the cron scripts works in PM and when it is triggered if it is not set. I have read that cron.php unpauses any case whose pause time has expired , could you tell how it works and when the cron.php executes if we didn't set it manually.

We have moved our DB to Amazon Aurora Serverless which automatically shutdown when the connection is 0, but its is not working because these queries are running in the background even if the connection is 0. Could you please help me to solve this issue ?
User avatar
By amosbatto
#825705
You have to manually set the cron scripts to execute, so that probably isn't the issue.

What version of ProcessMaker? Are you using the Enterprise Edition? If so, can you post a screen shot of the features and plugins that you have enabled?
By Vysakh
#825718
We are using Processmaker version 3.2.1 -community
Database MySql Version 5.6.10
Webserver Apache/2.4.18
PHP Version 5.6.40
Operating System Linux
User avatar
By amosbatto
#825783
Vysakh, I turned on the MySQL query log in my installation of PM 3.2.1 Community and I am not seeing those database queries happening when I'm not using the ProcessMaker interface. I suspect that something in Amazon's server is accessing your installation of ProcessMaker. Have you asked Amazon?
By Vysakh
#825798
Ok I will check with Amazon, and I have found that these queries are running from

/opt/processmaker/workflow/engine/classes/model/om/BaseAppCacheViewPeer.php and
/opt/processmaker/rbac/engine/classes/model/om/BaseSystemsPeer.php

do you have any concern with these php files ?
User avatar
By amosbatto
#825815
Vysakh wrote: Mon Aug 05, 2019 2:38 am /opt/processmaker/workflow/engine/classes/model/om/BaseAppCacheViewPeer.php and
/opt/processmaker/rbac/engine/classes/model/om/BaseSystemsPeer.php

do you have any concern with these php files ?
Those aren't security risks. Probably someone still has a web browser open with ProcessMaker, and the JavaScript is sending REST requests to get the case count from the APP_CACHE_VIEW table.
User avatar
By amosbatto
#825892
ProcessMaker uses standard PHP login sessions, which expire after 24 minutes of inactivity by default (that amount of time can be adjusted under Admin).
However, the JavaScript timer to update the case count in the Home menu doesn't know what is happening in PHP on the server, so it keeps sending out requests for the updated case counts, so you will keep getting database queries as long as ProcessMaker's Home page is open in a web browser. The reason why I say that this is not a security issue, is that this query just tells the number of cases (To Do, Draft, Participated, etc.). If you want to see the list of cases, then ProcessMaker will force the user to login again.
populate grids with trigger

Is your question how to populate a grid with a dat[…]

You can try using this: $mssqlId = '123456789abcd[…]

Changing the login page

In your pmos.conf, try changing from: Redirec[…]

I've created two endpoints for dealing with docume[…]