Skip to Content.
Sympa Menu

grouper-users - [grouper-users] Rule : problem with ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] Rule : problem with ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId


Chronological Thread 
  • From: SIAD <>
  • To:
  • Subject: [grouper-users] Rule : problem with ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId
  • Date: Thu, 05 Sep 2013 16:05:52 +0200

Hello,

I use a rule to assign disabled date on a membership.

My configuration :

ruleActAsSubjectId admin_grouper
ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId
ruleActAsSubjectSourceId ldapAdmin
ruleThenEnumArg0 365
ruleCheckType membershipAdd
ruleValid T
ruleThenEnumArg1 F

But, when i try this, the disabled date is set to 22/09/2013 and not to 05/09/2014 (+365 days).

I think, the problem is located in RuleElUtils class in the method assignMembershipDisabledDaysForGroupId.

More specifically, this line : membership.setDisabledTime(new Timestamp(System.currentTimeMillis() + (daysInFuture * 24 * 60 * 60 * 1000)));
daysInFuture is an integer, so Java think that the result of  daysInFuture * 24 * 60 * 60 * 1000 will be an Integer too. But with daysInFuture = 365, the result is too large for an integer.

i think, the problem can be resolve if we add (long) just before daysInFuture :
membership.setDisabledTime(new Timestamp(System.currentTimeMillis() + ((long)daysInFuture * 24 * 60 * 60 * 1000)));

Am i correct ?
Thanks for your help :-)

Yoann.
--
Yoann Delattre 03 20 95 69 61
Équipe SIAD (Systèmes d'Information et Aide à la Décision)
DSI de l'académie de Lille (Direction des Systèmes d'Information)
110 avenue Gaston Berger - 59000 Lille



Archive powered by MHonArc 2.6.16.

Top of Page