[Process Info] - Disallow Multiple Executions by different users

Description

In some cases, we don't want different users to be able to run the same process with same parameters (or not) in the same time. So, i propose to:

Rename the existing options in Allow Multiple Execution ref list, keeping the current behavior:
1. Disallow multiple executions with the same parameters and same user
2. Disallow multiple executions by same user

Create two more options in Allow Multiple Execution ref list, which do not consider the user running the process:

  1. Disallow multiple executions with the same parameters

  2. Disallow multiple executions

Environment

None

Attachments

2

Activity

Carlos Ruiz 
November 25, 2023 at 3:12 PM

Reopening because just found an issue with this ticket.

The column AllowMultipleExecution allowed nulls before this ticket.

This ticket made the column mandatory and assigned P as default, but all 2Packs generated after IDEMPIERE - 3799 and before this ticket have the definition as:
<AllowMultipleExecution/>
The 2Pack fails trying to set the AllowMultipleExecution=NULL

This was found trying to install the kanbanboard plugin in master (release-11), the error shown:

09:58:51.615-----------> Incremental2PackActivator.packIn: Installing kanbanBoard /META-INF/2Pack_6.1.0.zip ... [223] 09:58:51.654===========> DB.executeUpdate: UPDATE AD_Process SET Value=?, AD_ReportView_ID=?, Classname=?, AD_PrintFormat_ID=?, AD_Workflow_ID=?, AD_Form_ID=?, AD_CtxHelp_ID=?, AllowMultipleExecution=?,Updated=?,UpdatedBy=? WHERE AD_Process_ID=1000003 [PipoDS_cda53ed5-ab7e-4fcd-aa92-ed0ab16eae06] [223] org.postgresql.util.PSQLException: ERROR: null value in column "allowmultipleexecution" of relation "ad_process" violates not-null constraint Detail: Failing row contains (1000003, 0, 0, Y, 2023-11-25 09:58:45.648, 0, 2023-11-25 09:58:51.653, 0, KDB_CreateStatusProcess, Create Statuses in Kanban Board, null, null, 6, KDB, null, N, N, null, org.kanbanboard.process.CreateStatusProcess, 85, 1743, null, null, null, N, null, Y, null, null, N, ff5d472c-0c68-4de4-9733-1b26a84a9410, null, null, null, null).; State=23502; ErrorCode=0 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:152) at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) at jdk.internal.reflect.GeneratedMethodAccessor816.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.compiere.db.StatementProxy.invoke(StatementProxy.java:130) at jdk.proxy2/jdk.proxy2.$Proxy16.executeUpdate(Unknown Source) at org.compiere.util.DB.executeUpdate(DB.java:1039) at org.compiere.util.DB.executeUpdate(DB.java:1008) at org.compiere.model.PO.doUpdate(PO.java:3159) at org.compiere.model.PO.saveUpdate(PO.java:2825) at org.compiere.model.PO.save(PO.java:2507) at org.compiere.model.PO.save(PO.java:2740) at org.adempiere.pipo2.handler.ProcessElementHandler.startElement(ProcessElementHandler.java:84)

Carlos Ruiz 
September 20, 2023 at 9:03 AM

, can you please apply the patch provided at https://github.com/idempiere/idempiere/pull/1977#pullrequestreview-1619719215

Matheus Marcelino 
September 11, 2023 at 11:24 AM

I agree

Carlos Ruiz 
September 11, 2023 at 11:04 AM

Just tested this, and I find the terminology too confusing, disallow and prevent are basically the same thing.

Here https://github.com/idempiere/idempiere/pull/1977#pullrequestreview-1619719215 I’m proposing a different naming:

I think this is clearer, and it fits better in mobile view.

Heng Sin Low 
September 5, 2023 at 8:05 AM

hi ,

That looks fine to me. There’s one issue in the latest commit, the list text is different between the Oracle and PostgreSQL migration script.

Regards,

Low

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created August 24, 2023 at 2:06 PM
Updated January 2, 2024 at 1:00 PM
Resolved November 27, 2023 at 9:57 AM