From a2551a4fde78ad48134cd31fb5bec465df3c2e0d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 25 Jan 2008 22:46:19 +0000 Subject: [PATCH] Fix bug [ 1854603 ] Prepare method is being called twice Make workflows run in one single thread different from the main thread --- base/src/org/compiere/wf/MWFProcess.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/base/src/org/compiere/wf/MWFProcess.java b/base/src/org/compiere/wf/MWFProcess.java index a925069af2..83b7fbf5d9 100644 --- a/base/src/org/compiere/wf/MWFProcess.java +++ b/base/src/org/compiere/wf/MWFProcess.java @@ -333,8 +333,6 @@ public class MWFProcess extends X_AD_WF_Process // Start new Activity... MWFActivity activity = new MWFActivity (this, transitions[i].getAD_WF_Next_ID(), lastPO); - //new Thread(activity).start(); - //..but not in another thread activity.run(); // only the first valid if XOR @@ -461,9 +459,11 @@ public class MWFProcess extends X_AD_WF_Process { // Start first Activity with first Node MWFActivity activity = new MWFActivity (this, AD_WF_Node_ID); - //async execution cause problem with transaction - //new Thread(activity).start(); - activity.run(); + Thread workerWF = new Thread(activity); + workerWF.setName(activity.getAD_Workflow().getName() + " " + + activity.getAD_Table().getName() + " " + + activity.getRecord_ID()); + workerWF.start(); } catch (Exception e) {