Question

Need to get difference between 2 dateTime payload objects as duration format for using on HT expiration value. (i.e. returned as PT2055M or P1DT10H15M) Actually checked functions on that link: http://docs.oracle.com/cd/E23943_01/dev.1111/e10224/bp_appx_functs.htm#autoId13 And i tried to solve the issue by creating duration such as

concat("P", xp20:year-from-dateTime(string(bpmn:getDataObject('myPayloadDate'))) - xp20:year-from-dateTime(xp20:current-dateTime()) ,"Y", xp20:month-from-dateTime(string(bpmn:getDataObject('myPayloadDate'))) - xp20:month-from-dateTime(xp20:current-dateTime()),"M", xp20:day-from-dateTime(string(bpmn:getDataObject('myPayloadDate'))) - xp20:day-from-dateTime(xp20:current-dateTime()),"DT", xp20:hour-from-dateTime(string(bpmn:getDataObject('myPayloadDate'))) - xp20:hour-from-dateTime(xp20:current-dateTime()),"H",xp20:minute-from-dateTime(string(bpmn:getDataObject('myPayloadDate'))) - xp20:minute-from-dateTime(xp20:current-dateTime()),"M")

But realized that this approach interests with just only seperate values not whole values as expected. I could not find the right composition of functions to solve. Could you plz guide?

No correct solution

OTHER TIPS

Assuming you have an XPath 2.0 processor, just use the subtraction operator. For example

current-date() - xs:date('2001-03-04')

gives

P4744D

(You said "dates" but your examples look more like dateTime's. The subtraction operator will work with either.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top