Skip to content

Commit

Permalink
#37 Improved start of workflow in multiple threads. Impoved work on N…
Browse files Browse the repository at this point in the history
…odeActivatorJob with START nodes.
  • Loading branch information
Ihar Vouchak authored and Ihar Vouchak committed Jul 10, 2020
1 parent 076bfc6 commit 26f5fd6
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class ProcessManagerService implements InitializingBean {
*
* @return process ID value if process was started successfully
*/
public synchronized def startProcess(def processTypeID, def user, def variables) {
public def startProcess(def processTypeID, def user, def variables) {
// check processTypeID in supportedProcessTypes
if (!processFactory.getProcessTypes().contains(processTypeID)) {
log.error("Cannot start process of type '${processTypeID}'. Type is not supported.")
Expand Down Expand Up @@ -304,13 +304,13 @@ class ProcessManagerService implements InitializingBean {

updateProcessAssignees(basicProcess, processAssignees)

basicProcess.addToNodes(startNode)
BasicProcess.withTransaction {status->
basicProcess.addToNodes(startNode)

if (startNodeDef.forcedStart) {
grailsflowLockService.lockProcessExecution(startNode)
}
if (startNodeDef.forcedStart) {
grailsflowLockService.lockProcessExecution(startNode)
}

BasicProcess.withTransaction {status->
if (!basicProcess.save(flush: true) ) {
status.setRollbackOnly();
log.error("Cannot save process: "+basicProcess.errors)
Expand Down

0 comments on commit 26f5fd6

Please # to comment.