Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

Add Values in Global Varieble after Multiple Approval.

Created: 29 Jun 2010 | 3 comments
Everton Silva's picture

I have this situation.

I need to request approval to all CAB Members, the CAB Members is a Group in Active Directory.

If all CAB Members aprove request, the request go to next step (Implementation).

If one member reject request its necessary a CAB Meeting.

I try make this this way:

1. Create a request for each member.

2. Each time that a member approve AddValue (1) in Global Variable TOTAL_VOTOS

3. If one Member reject Add Value (100) in Global Variable Total Votos.

4. Each time, compare values TOTAL_Votos with Count(CAB_Members Group).

5. If TOTAL_VOTOS < Count(CAB Members) process in pause.

6. If TOTAL_VOTOS = Count(CAB Members) mean that all members approve the request, then go to Implementation Step.

7. If TOTAL_VOTOS > Count(CAB Members) mean that one member reject, then go to Meeting Step.

My problem is: The global variable TOTAL_VOTOS need be cumulative. For each approve need add 1 in TOTAL_VOTOS (TOTAL_VOTOS=TOTAL_VOTOS+1). But Add value only one time. After 3 member approve the request the value is 2 and not 4. (The TOTAL_VOTOS initial value is 1). 

See the image.

Can you help me?

Comments 3 CommentsJump to latest comment

reecardo's picture

To be clear, there's nothing preventing you from setting your "sum" variable equal to one of the variable you're adding 1/100 to. For example,

value 1 = global sum
value 2 = 1

output = global sum

is analagous to "global sum" = "global sum" + 1

Is this what you're meaning when you say you want it "cumulative"?

Everton Silva's picture
I understand, but as I need multiple approvals, the workflow not sum the value 1 in TOTAL_VALUE variable. Would be

Initial Value of TOTAL_VALUE = 1
 

First Approval - TOTAL_VALUE = TOTAL_VALUE + 1   (THE VALUE IN THE MOMENT IS 2)

Second Approval -  TOTAL_VALUE = TOTAL_VALUE + 1   (THE VALUE IN THE MOMENT IS 3)

Third Approval -  TOTAL_VALUE = TOTAL_VALUE + 1   (THE VALUE IN THE MOMENT IS 4)

....
 
but the system is running this way:

Initial Value of TOTAL_VALUE = 1

First Approval - TOTAL_VALUE = TOTAL_VALUE + 1   (THE VALUE IN THE MOMENT IS 2)

Second Approval -  TOTAL_VALUE = TOTAL_VALUE + 1   (THE VALUE IN THE MOMENT IS 2)

Third Approval -  TOTAL_VALUE = TOTAL_VALUE + 1   (THE VALUE IN THE MOMENT IS 2)

I am using "ADD VALUES COMPONENT" this way:
 

FIRST VALUE = [[Global].TOTAL_VOTOS_GAM]
 
SECOND VALUE = value : 1
 
OUTPUT VARIABLE NAME = [Global].TOTAL_VOTOS_GAM
 

 

Y

Alistair Crawshaw's picture

I have an alternative suggestion for solving your problem.  As you have said it only takes one rejection for the change to be sent to a CAB meeting.  So you can remove the global count of rejections/ approvals and the compare numbers rule.  

  1. Prior to entering the for each element component have a new data element component of type logical, set this to false.
  2. On the rejection/ timeout path from the dialog box set this to true.
  3. Remove the pause component and replace with a wait for all workflow components (merge) component.  Have all the paths from the dialog going to this.  This will wait until all the dialog tasks have been closed.
  4. After the wait component have a true/false rule checking the previous logical data type.  Have the false path going to implementation and true going to CAB meeting step.  The only way the process will go to implementation is if no one has rejected the change.

Developer
Protirus UK