update daysAvailableCounter vacation Request

1
0
-1

Hello everybody
anyone can help me pleeease , in leave request when I do the first one a leave request the currentbalance(daysAvailable) updated but the second one back to the daysAvailableInitial
For exemple daysInitialValue = 60
new request( NbreDays=5 ) --> daysAvailableCounter:60-5=55
second request (NbreDays = 3)--> daysAvailableCounter 60-3=57 shoud be do daysAvailableCounter 55-3= 52
thanks in advance
this is my process.bos
https://www.dropbox.com/home?preview=DemandeConges-19.0.bos

Comments

Submitted by Sean McP on Wed, 05/03/2017 - 21:23

There is an issue with the logic of your program, you are:

either not saving 55 into the record correctly, or
you are getting the wrong record

something you need to walk through very carefully, understand and fix yourself. I don't have a couple of free hours to do this, sorry.

Submitted by helaguesmi on Wed, 05/03/2017 - 23:06

@ Sean MCP I speak about the official exemple of bonita vacation management example

Submitted by Sean McP on Thu, 05/04/2017 - 01:28

You mean this one?
https://github.com/Bonitasoft-Community/vacation-management-example

If there is a problem with it you should create an issue on the Github page for the example here

Bonitasoft support this example to ensure customers can use it.

regards

Submitted by helaguesmi on Thu, 05/04/2017 - 12:19

it is resolved . an error in the code of official example
while ((currentlyExistingVacationAvailable = VacationAvailableDAO.find(offset, increment)).size() > 0) {
for (VacationAvailable va : currentlyExistingVacationAvailable) {
// Update the list of user ids for user who already have an associated VacationAvailable object
alreadyKnownEmployeeId.add(va.bonitaBPMId)
// Reset the vacation available counter
va.daysAvailableCounter = daysAvailableInitialValue

==>
while ((currentlyExistingVacationAvailable = VacationAvailableDAO.find(offset, increment)).size() > 0) {
for (VacationAvailable va : currentlyExistingVacationAvailable) {
// Update the list of user ids for user who already have an associated VacationAvailable object
alreadyKnownEmployeeId.add(va.bonitaBPMId)
// Reset the vacation available counter
va.daysAvailableCounter = va.getDaysAvailableCounter()

No answers yet.
Notifications