1
0
-1

I have 2 workflow (Main and voting )

when the main workflow generate voting processes 

Main contains 2 workflow variables:

voteYes - number of processes(voting workflow) that votes yes

voteNo - number of processes(voting workflow) that votes no

voted - number of voted users

In voting activity

there is only one activity that user vote yer/no then a tool that increment the voted variable and increment voteYes if he choose yes

code:

String count = workflowManager.getProcessVariable(mainProcessId, variableName);
int countInt;
countInt = Integer.parseInt(count) + 1;
count = Integer.toString(countInt);
workflowManager.processVariable(mainProcessId, variableName, count);


the problem:

No synchronization , If 5 users vote together the main variables will not be correct

How to synchronize using of another workflow variable using beanShell 
Is there a way to add OS metaphor, Semaphor or Mutex

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi, you may want to change your app design to capture each individual user vote. In this case, then you can easily perform a sum or any other analysis on the votes as required.

        CommentAdd your comment...