FORUMS


Discussion about Intalio|BPP Community Edition.


Back to General Questions (0 viewing) 
Go to bottom Favoured: 0
TOPIC: Re:how to do arithmetic functions on "date"..?
Jul 30, 2008 7:15 am
41 posts
Senior Boarder

Karma: 0  
Hi All,

Simply I want to do some arithmetic functions on date. I saw some functions have listed in Mapper Palette. But when I drag one function into the mapping area, it getting red as an error. I can't map it with another one further. Though I went through the references, I couldn't find a sufficient answer.

Let's say, I want to increase only the year by 5 on given date. Then how can I do it?

Thank You!
 
  The administrator has disabled public write access.
Jul 30, 2008 8:15 am
venkaiah.k (User)
215 posts
Gold Boarder

Karma: 4  
Hi,

Which designer build you are using?

Thanks,
Venkaiah.
 
  The administrator has disabled public write access.
Jul 30, 2008 8:27 am
41 posts
Senior Boarder

Karma: 0  
Sorry for the disturbance. Actually I forgot to mention it before.

Designer (linux)- 5.1.0.022
Server - 5.1.0.019

Thank You!
 
  The administrator has disabled public write access.
Jul 30, 2008 8:29 am
41 posts
Senior Boarder

Karma: 0  
Sorry for the disturbance. Actually I forgot to mention it before.

Designer (linux)- 5.1.0.022
Server - 5.1.0.019

Thank You!
 
  The administrator has disabled public write access.
Jul 30, 2008 9:08 am
dfrench (User)
367 posts
Platinum Boarder

Karma: 14  
Simple arithmetic on dates can be done with the date defined as xs:date and the increment as xs:duration (see here) so adding 5 years to the current date is created in mapper as:

current-dateTime()+"P5Y"

[UPDATE ... while you can enter that ok into mapper, or assign a "P5Y" into a duration type variable, the result does not execute ... I get
current-date() + $dur)}": Error while executing an XPath expression: net.sf.saxon.trans.DynamicError: Unsuitable operands for arithmetic operation (xs:date, xdt:untypedAtomic)]
 
 
Last Edit: 2008/07/30 11:36 By dfrench.
  The administrator has disabled public write access.
Jul 30, 2008 9:43 am
41 posts
Senior Boarder

Karma: 0  
Thank You dfrench...

But still the problem is remain. When I draw "current-dateTime()+"P5Y"" in mapper area, still it is red colored. I can't map it to the right field.

Suppose that user has entered a date already. We have to add years for that. Then the mapping will be how?

Thank You!
 
  The administrator has disabled public write access.
Jul 31, 2008 6:28 am
41 posts
Senior Boarder

Karma: 0  
Hi All,

Still the problem is remain. Can anybody help me on this matter. Please.

Thank You!
 
  The administrator has disabled public write access.
Jul 31, 2008 2:31 pm
venkaiah.k (User)
215 posts
Gold Boarder

Karma: 4  
Hi,

Some functions were not implemented in the 5.1 builds.
Could you please try with the latest 5.2 builds.
I hope it will resolve your issue.

Thanks,
Venkaiah.
 
  The administrator has disabled public write access.
Jul 31, 2008 9:47 pm
dfrench (User)
367 posts
Platinum Boarder

Karma: 14  
my problems were with 5.2.0.091
 
  The administrator has disabled public write access.
Aug 1, 2008 7:14 am
41 posts
Senior Boarder

Karma: 0  
Hi All,

I have installed designer 5.2 and trying to do the date arithmetics.

But which function should i use to add some years to given date? And how should I do the mapping part?

Thank You!
 
  The administrator has disabled public write access.
Aug 1, 2008 9:50 am
venkaiah.k (User)
215 posts
Gold Boarder

Karma: 4  
Hi,

You can use the xpath function available under Mapper Palette for duration and date.


Thanks,
Venkaiah.
 
  The administrator has disabled public write access.
Aug 1, 2008 11:45 am
dfrench (User)
367 posts
Platinum Boarder

Karma: 14  
Perhaps you could take the time to show how you achieve this.
The attached project has a variable of type xs:duration which is added to the result of the current-date() function. This is a valid arithmetic function on date and duration type and is validated by designer BUT fails in execution.
Code: :

 An exception occured while evaluating "{OXPath10Expression current-date() + $dur}"Error while executing an XPath expressionnet.sf.saxon.trans.DynamicErrorUnsuitable operands for arithmetic operation (xs:datexdt:untypedAtomic)



This is certainly a bug, if only because invalid operands should be detected in Designer but the execution seems to be misinterpreting the type.
File Attachment:
File Name: xpath.zip
File Size: 14909
 
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop

Top Posters

Last 30 days

  • vivek.kv1 (11)
  • mohamed.chargui (10)
  • madhav.vodnala (8)
  • inian.kamaraju (4)
  • abdul.haleem (4)
  • parsaulian.p (4)
  • ahsan.zeb.durrani (3)
  • andreas.boehm (3)
  • Konstantin.Melnik (3)
  • siddharth.khurana (2)

All time

  • Antoine (2754)
  • Shivanand (1194)
  • cshekhar (933)
  • psq (797)
  • metabyte (415)
  • jag (393)
  • dfrench (367)
  • arnaud (329)
  • jalateras (325)
  • talita.pezzi (261)

Show last 4 hrs - 12 hrs - 24 hrs

Copyright © Intalio, 1999-2010.