Add-dayTimeDuration-to-dateTime

Hi,
Could you please tell me why the second assignment is not working? I have no errors but the variable var2 is empty.
<variable name="var1" type="xsd:dateTime"/>
<variable name="var2" type="xsd:dateTime"/>
<copy>
<from expression="xp20:current-dateTime()"/>
<to variable="var1"/>
</copy>
<copy>
<from expression="xp20:add-dayTimeDuration-to-dateTime(bpws:getVariableData('var1'),'P10S')"/>
<to variable="var2"/>
</copy>
Thanks
Olivier

A Oracle Metalink Note is writte on this isse, note nr: 356899.1
https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=356899.1
My code:
<copy>
<from expression="xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),&quot;PT1H&quot;)"/>
<to variable="var_datetime"/>
</copy>

Similar Messages

  • Add-dayTimeDuration-to-dateTime not working just before format-dateTime

    Hi,
    I am using format-DateTime function just after add-dayTimeDuration-to-dateTime function in XSLT mapping.
    But the response coming doesnot providing the result of add-dayTimeDuration-to-dateTime function.
    When I use both the functions individually then both works fine.
    Please let me know any solution for this.
    Thanks

    Hi Arpit,
    Can you try converting the output of add-dayTimeDuration-to-dateTime to string, before passing it to format-DateTime.
    Also can you post your piece of xslt that you are trying to work out with an example.
    Please do mention what exactly you are trying to do.
    I have tried this and its working fine.
    <xsl:value-of select="xp20:format-dateTime(string(xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),'PT15S')),'[D01]/[M01]/[Y0001]')"/>
    Please let me know if this helps.
    Thanks,
    Deepak.

  • How can add Hours in datetime and result is also in datetime?

    Hi Friends,
    How can add Hours in datetime and result is also in datetime?
    I want such as 22-11-2006 10:30=22-11-2006 08:30+2 from dual
    Select (22-11-2006 08:30+2) from dual;
    And Result should be in this form 22-11-2006 10:30
    Best regards,
    Shahzad

    sql>
    select col1, col1 + interval '1' hour
    from t;
    COL1 COL1+INTERVAL'1'HOUR
    04-DEC-06 12.21.55.000000 PM  04-DEC-06 01.21.55.000000000 PM                                                                                                                                                                                                                                                                                                                               

  • Add Seconds to DateTime value

    My data source has some columns I want to add together.
    StartDate, which looks like 12/26/2014 4:13:40 PM
    and
    QueueTime, which is a whole number integer like 45088 (number of seconds)
    I want to add these together (the correct result would be 12/27/2014 4:45 AM).
    Can you let me know how to add these?  I didn't see any formulas to use for it in the Power Query forum index, but I also tried this with failure:
    =[StartDate] + ( [QueueTime]/86400 )
    This returned an error.
    Shawn Keene

    Thanks a ton! Didn't know you could do that with the duration type.
    Shawn Keene

  • How to add date in XSLT?

    All,
    soa version: 11.1.1.4
    There is a requirement for me to add date to the current date in XSLT.  I searched in 'Data functions', there I couldn't find any pre-defined functions.  How do I achieve it in XSLT?  Any help is appreciated.
    thanks
    sen

    Hi Sen,
    You can do this using the below:
    <xsl:value-of select="xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),'P1D')"/>
    You can change the P1D based on the number of days you want to add.
    For example 3 days = P3D
    Thanks,
    Deepak.

  • Compare two dateTime with different timezone

    HI, All,
    I found a strange thing when compare two dateTime in BPEL;
    In my BPEL process, client passed a date time to the process , and the process compare the date time with current data time.
    1.client pass cutoffDate to process
    2. in a switch activity, I compare cutoffDate with current date. code:
    bpws:getVariableData('cutoffDate')<=xpath20:add-dayTimeDuration-to-dateTime()
    but seems this compare ignored the timezone information.
    For example:
    cutoffDate=2010-03-05T06:17:38.838+00:00
    currentDate=2010-03-05T14:10:38.838+08:00 this time =2010-03-05T06:10:38.838+00:00
    but cutoffDate<currentDate == true... seems it ignored the timezone info..
    This is a bug or I used a wrong compare function?
    Thanks.
    Edited by: Colin Song on Mar 5, 2010 3:28 PM

    Hi Colin,
    Please go through below link, there is topic about calculating difference between dates. Hope you find solution.
    http://blogs.oracle.com/reynolds/2007/07/19/
    Please let me know, if still not successful.
    Thx,

  • Adding 1 day to a date in BPEL

    Hi,
    Im trying to add 1 day to a date in a BPEL proces. I saw that there was a xp20:add-dayTimeDuration-to-dateTime so I tried using this in several ways. I didnt expect the input variable to be a string. I tried converting my date to a string and adding 1 day like this:
    xp20:add-dayTimeDuration-to-dateTime(xp20:format-dateTime(string(bpws:getVariableData('inputVariable','payload','/ns1:GereedMeldenRoosterRequest/StartDatum')), 'YYYY-MM-DD'), 'P1D')
    But the variables which I try to fill stays empty. The element which I try to fill is of type dateTime. Is this maybe the error that add-dayTimeDuration-to-dateTime returns a string and it cannot cast it to dateTime?
    Can anyone tell me how to solve this properly?
    Thanks in advance!

    Hi,
    I refactored my expression to look like this:
    xp20:format-dateTime(xp20:add-dayTimeDuration-to-dateTime(bpws:getVariableData('inputVariable','payload','/ns1:GereedMeldenRoosterRequest/StartDatum'), 'P1D'), '[Y]-[M]-[D]')
    But the I receive an error: XMLElement cannot be cast to java.lang.String
    Then I tried:
    xp20:format-dateTime(string(xp20:add-dayTimeDuration-to-dateTime(bpws:getVariableData('inputVariable','payload','/ns1:GereedMeldenRoosterRequest/StartDatum')), 'P1D'), '[Y]-[M]-[D]')
    Because xp20:add-dayTimeDuration-to-dateTime needs a String as input and I dont know how getVariableData returned it but with this I get the error:Parse Error in string function
    Any ideas?

  • How to compare to date and From date in XSLT

    Hi,
    I have to check in my process "*To date*" and "*From date*" and make "*To date*" greater than or equlas to "*From date*"..
    Is there any function which performs this task.
    I will appreciate if someone can provide any Solution on the same..
    Thanks in advance..

    Hi,
    You can compare dates in XSLT as in BPEL and in XPath using &lt; and > and =, you can even add a duration in days or months to your date using xp20:add-dayTimeDuration-to-dateTime()
    The only but is all the dates have to be in ISO 8601 Format...
    http://www.w3.org/TR/NOTE-datetime
    For example:
    *1994-11-05T08:15:30-05:00* corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
    *1994-11-05T13:15:30Z* corresponds to the same instant.
    The following will return true if $dateFrom is less than $dateTo...
    <xsl:value-of select="$dateFrom &lt; $dateTo"/>Cheers,
    Vlad

  • How to programatically set  HT expiration based on BPM process?

    Hi All,
    I'm developing a BPM process with human tasks. Is there a way by which I can set the task to expire 35 days after the date the instance of the BPM process was spawned? I see within the task an option to set Expiration after a fixed number of days, but my scenario requires that I compare the current date with the date on which the instance of the BPM process was created and set to expire accordingly.
    Is this achievable? If not directly are there any suggested programmatic approaches to achieve this?
    JDev : 11.1.1.4
    Thank you.
    PP.

    Don't know if you know how to get the number of days, hours, minutes that you want to wait and then put that into a either a string or integer variable (no decimals). If you know how to do this, then the code below should help. These examples assume you want to wait a certain number of days and this number is passed in using the variable "sla".
    Setting the human task's deadline
    The human task deadline timer can be set programmatically from a process variable using an XPath expression. In the human task's "Deadline" tab select "By Expression" from the dropdown. In the example below, the XPath expression would this if you had an string or integer variable called "Sla" and you wanted to set the number of days based on this variable:
    concat("P0Y0M",/task:task/task:payload/task:Sla,"DT0H0M0.0S")
    Setting the Interactive activity's deadline
    You'll also want to set a boundary timer event on the Interactive activity set to the same duration. The syntax for this logic is different than the human tasks deadline. In the timer event, if you use the radio button "Time Date", the XPath expression to set the number of days based on a variable would be:
    xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),concat('P0Y0M'  ,bpmn:getActivityInstanceAttribute('SUBPROCESS3082641628371', 'inputDataItem')/ns:sLA,'DT0H0M0.0S'))If you instead select the timer event's "Time Cycle" radio button, the logic would be:
    concat('P0Y0M',bpmn:getActivityInstanceAttribute('SUBPROCESS3082641628371', 'inputDataItem')/ns:sLA,'DT0HM0.0S')Dan

  • Timer Expression - Interval Literals Issue

    Hi
    JDeveloper 11.1.1.6, WLS 10.3.6, BPM 11.1.1.6
    I am trying to use XPATH expressions in the Timer Catch Event
    I tried giving the Interval Literal as in the 26.12.3 section of Writing Expressions - 11g Release 1 (11.1.1.6.1)
    All I want to do is set the timer value to 1 minute.
    I gave the XPATH expression as '1m'
    I have even tried giving the expression value as a variable from process data object and still it does not work.
    I selected Time Cycle, and Use Expression, XPath Exp : bpmn:getDataObject('timerData')/ns:timerValue
    The following post also mentions that it works if we give the literal as 2h
    https://forums.oracle.com/message/11067100#11067100
    I tried the timer as a catch event in the process and boundary event on a human task, but both are not working.
    The process comes to the timer event and stops there. The Audit Trail/Flow in EM does not show it entered the timer event.
    Can you please let me know if I am missing anything.
    Thanks and Regards
    Sameer

    Hi Sameer,
    With timer event logic, part of the confusion stems from the two syntaxes you can have based on the "Time Date" (elapse at some time in the future) or "Time Cycle" (elapse after the time period specifies elapses).
    If all you want to do is to have the event time out after one minute, you could use this syntax if the Time Cycle radio button is selected:
        string(‘PT1M’)
    This won't work without casting it to a string as shown above.  The upper case "M" above is correct and does not mean month in this case because it is after "T" in the expression.
    If you wanted one year, 3 months, 5 days, 7 hours, 10 minutes and 3.3 seconds the syntax would be:
        string(‘P1Y3M5DT7H10M3.3S’)
    If you wanted the event to expire after one minute and wanted to use the Time Date syntax (by selecting the Time Date radio button), the syntax would instead be:
        xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),'PT1M')
    This logic is for the Timer events.  Strangely, the deadline syntax that you use to set in a Human Task's deadline is slightly different.  Human Task deadlines are important because they establish the value that will appear to end users in the Workspace's Expires column.
    Dan

  • Java Embedding Weird XML Node Error

    Ok, I am going crazy. I have a java embedding node that takes a date string in, changes it to a different format and creates another date that contains the current time. if I run this in java to code run ok and there are no issues. At the end of the java I print out the string and they are exactly what I want. The thing that is going on is when I set the 2 string BPEL variables in the java embedding, when I try to reference them the 2nd time,I get a weird node object error. I get through the first pass ok. when I try to reference Test1 or Test2 on the 2nd pass I get the error below. Its like when I set the variable currentDB2UpdateDate and currentDB2CurrTimeDate it does something to them. Instead of setting it to just the string it seems to set it to some kind of object.
    I have 3 steps here. Assign -> Java Embedding -> Assign.
    Assign 1 => Initialize 2 String variables to X.
    <code>
    <assign name="Assign_2">
    <copy>
    <from expression="string('X')"/>
    <to variable="currentDB2UpdateDate"/>
    </copy>
    <copy>
    <from expression="string('X')"/>
    <to variable="currentDB2CurrTimeDate"/>
    </copy>
    </assign>
    </code>
    Java Embedding =>
    <code>
    String currentFileDate = (String)getVariableData("currentFileDate");
    String currentDate = "";
    try
    SimpleDateFormat sdfSource = new SimpleDateFormat("MM/dd/yyyy");
    Date date = sdfSource.parse(currentFileDate);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    currentFileDate = sdfDestination.format(date);
    catch(ParseException pe)
    System.out.println("Parse Exception : " + pe);
    try
    Calendar cal = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    currentDate = sdf.format(cal.getTime());
    catch(Exception pe)
    System.out.println("Parse Exception : " + pe);
    System.out.println("currentFileDate : " + currentFileDate.toString());
    System.out.println("currentDate : " + currentDate.toString());
    setVariableData("currentDB2UpdateDate",currentFileDate);
    setVariableData("currentDB2CurrTimeDate",currentDate);
    </code>
    Assign 3 =>
    <code>
    <assign name="Assign_1">
    <copy>
    <from variable="currentDB2UpdateDate"/>
    <to variable="Test1"/>
    </copy>
    <copy>
    <from variable="currentDB2CurrTimeDate"/>
    <to variable="Test2"/>
    </copy>
    </assign>
    </code>
    <code>
    <bpelFault><faultType>0</faultType><selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>Invalid to part type.
    When performing the assign operation, the to node 2010-07-17 12:00:00 is invalid.
    The node named in the error message was either null or an empty node set, and it was not an instance of org.w3c.Element.
    Verify the node value at line number 819 is not null and is an instance of org.w3c.Element.
    </summary></part></selectionFailure></bpelFault>
    </code>
    The 2nd pass to this throws the following error when trying to set Test1 and Test2 again... Its like it is setting the variable to an object and not just the string. I tried using toString() in the setVariable too and it didn't work. I don't get it.
    Edited by: 806312 on Dec 1, 2010 8:13 AM
    Edited by: 806312 on Dec 1, 2010 8:26 AM

    I am also facing a similar issue.There is selection failure in assignment to local variable of BPEL .
    PFB the logs :
    parts: {{
    summary=&amp;lt;summary&amp;gt;Invalid to part type.
    When performing the assign operation, the to node false is invalid.
    The node named in the error message was either null or an empty node set, and it was not an instance of org.w3c.Element.
    Verify the node value at line number 3577 is not null and is an instance of org.w3c.Element.
    &amp;lt;/summary&amp;gt;}
    Here is the code:
    <copy>
    <from expression="xpath20:add-dayTimeDuration-to-dateTime($calculatednpexectime,'P200YT')"/>
    <to variable="calculatednpexectime"/>
    </copy>
    It seems as if Oracle is not accepting the date format .
    Is there some issue with local variables of new version of BPEL ??

  • Deadline of Human task

    hello ,
    I follow the API using the XPath in deadline of Humantask:
    xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),concat('PT',string(/task:task/task:payload/ns1:Task/ns1:expiryDay),'D'))
    it means the duration will be base on the days number input from client (/task:task/task:payload/ns1:Task/ns1:expiryDay)
    but after deploy on server the test get error:
    Error in routing slip. The expiration specified in the routing slip could not be evaluated. The error is java.lang.IllegalArgumentException: . The routing slip is associated with the task definition default/Sample!1.0*soa_24a7ee84-c5f5-4332-8c74-4ca463d384ff/Audit. Make sure that the expiration duration is specified correctly. The value should conform to XML duration specifications.
    how can i solve it. thanks very much.
    Regards,
    Tang
    Edited by: 901572 on Dec 16, 2011 12:23 AM

    Human Tasks have "Escalate After " feature built-in. In the human task editor, you can specify the escalation time (either fixed or as variable -based on an expression) in the "Expiration and Escalation Policy" section. Refer to : http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/workflow.htm#BABDDIAJ
    You can then use one of the callback from the Human Task to update the task's priority or assign it to different users.
    Hope that helps.
    Regards,
    Sidda.

  • Invalid XPath ?

    I have a process that gets a date (format YYYY-MM-DD; forced by Console), which has to be delivered to a Webservice, that requests dates in format 'dd MMM yyyy' (24 aug 2005).
    I've tried the following options (in an Assign):
    <copy>
      <from variable="inputVariable" part="payload" query="ora:formatDate('/client:bpAanvraagProcessRequest/client:DatumBemonstering', 'dd MMM yyyy')"/>
      <to variable="addAanvraag_addaanvraag_InputVariable" part="pDbg"/>
    </copy>And:
    <copy>
      <from variable="inputVariable" part="payload" query="xp20:format-dateTime(/client:bpAanvraagProcessRequest/client:DatumBemonstering,'[dd] [MMM] [YYYY]')"/>
       <to variable="addAanvraag_addaanvraag_InputVariable" part="pDbg"/>
    </copy>Both fail with the following message:
    [Error ORABPEL-10076]: invalid xpath query string 
    [Description]: in line 68 of "L:\workspaces\BPEL\bpAanvraag\bpAanvraag.bpel", According to BPEL4WS spec 1.1, section 14.3,
    the xpath query "ora:formatDate('/client:bpAanvraagProcessRequest/client:DatumBemonstering', 'dd MMM yyyy')" is invalid,
    query should be an absolute location path and it must start from the root element prefixed with "/".. 
    [Potential fix]: Please make sure that your xpath query starts with "/" which is the root..Anyone has any ideas how to fix this?

    Okey, found it:
    The format-string is an XSLT 2.0 picture string, see syntax explained at http://www.w3.org/TR/xslt20/#date-picture-string
    By the way:
    a) w3.org publishes the function xslt:format-date(), and format it by picture. This is not offered by Oracle BPEL it seems (at least not through the Expression builder, ver 10.1.2.0.0 ).
    Oracle-BPEL offers:
    b) ora:formatDate(), and format it by java.text.SimpleDateFormat.
    c) xp20:format-dateTime(), and format it by picture.
    So I took it away by code like:
    <copy>
    <from expression="xp20:current-dateTime()"/>
    <to variable="myDateTime"/>
    </copy>
    <copy>
    <from expression="'P21D'"/>
    <my-xml-comment>The Xpath syntax (like P21D) is for specifying an xdt:dayTimeDuration of 21 days ahead, see http://www.w3.org/TR/xpath-functions/#lexical-dayTimeDuration</my-xml-comment>
    <to variable="myDuration"/>
    </copy>
    <copy>
    <from expression="xp20:add-dayTimeDuration-to-dateTime( bpws:getVariableData('myDateTime'), bpws:getVariableData('myDuration') )"/>
    <to variable="myResultTime"/>
    </copy>
    <copy>
    <from expression="xp20:format-dateTime( bpws:getVariableData('myResultTime'), '[Y0001][M01][D01]' )"/>
    <to variable="myResultTimeNOARK"/>
    </copy>

  • DST bug converting dates

    I'm using BPEL 10.1.2.0.2 in GMT+01 (UK BST) timezone and am noticing incorrect conversion being carried out by xp20:format-dateTime and ora:formatDate() functions.
    I am creating a dateTime variable by adding a duration of PT17H30M to the value returned from xp20:current-date() e.g.
    xp20:add-dayTimeDuration-to-dateTime(xp20:current-date(), PT17H30M)
    This is then assigned to a xsd:dateTime variable in BPEL. The BPEL variable contains a value of 2007-04-18T17:30:00+00:00 which is incorrect, as the timezone offset portion should actually be +01:00. I think I may have read somewhere that BPEL ignores the timezone offset's so this may not actually be an issue.
    If I then format the contents of this variable with either xp20:format-dateTime() or ora:formatDate(), the results are wrong e.g.
    xp20:format-dateTime() returns a time portion of 18:30:00+00:00 which is incorrect as it should either be 17:30:00+01:00 or 16:30:00+00:00..
    ora:formatDate() returns a time portion of 17:30:00+01:00 which is correct if we ignore the timezone portion of the input value which was +00:00.
    Is there a fix for this?
    Regards,
    Toby

    I have noticed a related problem concerning xp20:current-dateTime() and the database adapter.
    xp20:current-dateTime() generates a datetime value such as 2007-05-16T09:45:39+00:00 which contains an offset of +00:00. Our timezone is in fact +01:00. The time value is correct as it is 09:45, however the offset is incorrect.
    When the database adapter processes this value, an hour is added to the time element producing an incorrect value of 2007-05-16 10:45:39 when querying the table from SQLPlus.
    Are there any patches/fixes available for this problem?
    Toby

  • How to subtract time from dateTime in xquery?

    How to subtract time from dateTime in xquery??
    In ALDSP i tried to use the function xf:add-days but it is showing an error saying invalid function name. I think this namespace is not valid for ALDSP. Is there is any way to add this function in ALDSP???

    xquery functions and operators documentation is here :
    http://www.w3.org/TR/xpath-functions/
    It sounds like you want to ..
    op:subtract-dayTimeDuration-from-dateTime
    this is not an xquery function that you can call, it is an xquery operation defined by the specification
    I believe you can simply use the '-' operator to use that operation.
    <newDateTime>
    { $myDateTime - $myTime }
    </newDateTime>

Maybe you are looking for

  • Can I open a new document in a new desktop in OS Mountain Lion?

    The standard way of doing so is to open the document in the current desktop and then drag it to a new desktop (top right)? I was wondering whether a shortcut operation exists? (something like open in a new tab when navigating on Safari). Thank you

  • Help on Solaris 8 installation

    I have tried to install Solaris 8 couple of times but it�s failed. I get this HEX dump after installation is completed. Is there something I am doing wrong in my partition. I have the following Partitions On disk one(8G approx): / => 4000Megs swap =>

  • Current quarter and four future quarters

    Hello Forum Members, I have a config table with the following data: Quarter Config Rep_date Q1-2006|1|1/1/2006 Q2-2006|32|4/12/2006 Q3-2006|321|7/15/2006 Q4-2006|897|12/14/2006 Q1-2007|10|2/12/2007 Q2-2007|10|5/12/2007 Q4-2007|50|11/12/2007 Q1-2008|3

  • Including a variable in cmax

    This is a very simple one... but it is slowly driving me mad. I have some data, i want to know the maximum, but i want to go through several channels so i'm using a variable for my channel number.... Option Explicit  'Forces the explicit declaration

  • A question about migration assistant

    Hello, I have a start up hard drive going bad, and I'd like to migrate all of my apps, prefs and user data to another internal drive. Can I use Migration assistant to do this? Do I have to start up from the drive I'm migrating to? The newer drive alr