Jump to content

Expiry field data format for variable - how do I find this out, please?


Berto2002

Recommended Posts

hi, I am attempting to use a variable to set the expiry time in an external authorisation node. The variable needs to be based on the outcome of a human task selection. what I cannot find in the wiki is the data format for how that expiry variable needs to be stated since it can have days hours and minutes. I assume it's something like dd:hh:mm but there is also no 'help' link on that node to find out? help on what human task input types would work to give this output would also be appreciated. thanks you

image.thumb.png.94799316d82e62a226995ed5588a1ba4.png

Link to comment
Share on other sites

@Berto2002 the date/time values here need to be in ISO 8601 format. Durations in this format define the amount of intervening time in a time interval and are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. In these representations, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading zeros are not required. The capital letters P, Y, M, W, D, T, H, M, and S are designators for each of the date and time elements and are not replaced.

  • P is the duration designator (for period) placed at the start of the duration representation.
  • Y is the year designator that follows the value for the number of calendar years.
  • M is the month designator that follows the value for the number of calendar months.
  • W is the week designator that follows the value for the number of weeks.
  • D is the day designator that follows the value for the number of calendar days.
  • T is the time designator that precedes the time components of the representation.
  • H is the hour designator that follows the value for the number of hours.
  • M is the minute designator that follows the value for the number of minutes.
  • S is the second designator that follows the value for the number of seconds.

For example, "P3Y6M4DT12H30M5S" represents a duration of "three years, six months, four days, twelve hours, thirty minutes, and five seconds"

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...

@Victor Hi. just tried to use this feature but I get this error;

Xmlmc method invocation failed for BPM invocation node 'stage-778afaca/task-13726f8e': <methodCallResult status="fail"> <state> <code>0203</code> <error>The dateTime value &apos;P0Y0M0DT1H0M0S&apos; specified is invalid or out of range for element &lt;expires&gt;, at location &apos;methodCall/params/expires&apos;</error> </state> </methodCallResult>

My Human Task has this expiry:

image.png.8ca5018d590984b6874523cdb5207f1d.png

I write the varaible/value to the timeline just before the node:

image.png.51e8100e76f4c0a3c2684485565485e8.png

I thought this was due to the use of zeros (although the standard does not say zeros must be removed - ISO 8601 - Wikipedia)

I tried specifying 5 minutes as "PT5M" (Copying the Wiki article which states: "To resolve ambiguity, "P1M" is a one-month duration and "PT1M" is a one-minute duration") but that also fails.

Xmlmc method invocation failed for BPM invocation node 'stage-778afaca/task-13726f8e': <methodCallResult status="fail"> <state> <code>0203</code> <error>The dateTime value &apos;PT5M&apos; specified is invalid or out of range for element &lt;expires&gt;, at location &apos;methodCall/params/e...

Can you help me out a bit here as the system does not seem to be accepting my values.

I am deriving my values from a Simplelist and experimenting with values to try to find ones that work:

image.thumb.png.58fa173b5a4fcbd316ac433a08ae49d9.png

Thanks,

Berto

Link to comment
Share on other sites

@Berto2002 I've just run a test inserting PT5M into a Custom Field, then using that in the Expires After variable which worked with no issues.

This suggests that the most like issue is what is being inserted into the node by the variable.

I was under the impression that Task Variable always present the Display Value, which does fit the symptoms - but I would have thought that would have shown in the Timeline Update.

Link to comment
Share on other sites

@Steve Giller could it be related to this I raised last year?

When I enter the variable from the Human Task output into the Expiry field, I do not get a choice as to whether to use the Display or Raw value (which I pointed out as annoying in the above post because I need both under different circumstances).

I tried putting the selected outcome from the task into a custom field and it did indeed hold PT5M. I then tried using the custom O value in the Expiry node for the Human Task and that failed still.

image.png.788ca8766bf20a5a65e819a352e8fc51.png

 I think I need to raise this in Support more formally so you can look at my instance.

Link to comment
Share on other sites

I've just noticed that I missed you were referring to both taking the answer from a Task and setting the expiry on another Task.

As detailed on the wiki page, that's not how this parameter works for Tasks.

Quote
  • Expires After - Expires is a valid outcome for a human task, and setting a value here will allow you to via a decision node following the task allow for branching based on an outcome not being selected but the task expiring.
Set this to either X Days, X Hours and or X minutes after the creation of the Task, or base this on a variable like log date, respond by, or fix by. If using the Variable option remember to precede the node with the Automated Task Node > Request Entity > Get Information > Request Details
Please note: When using variables for the Lifespan Settings these must be in the ISO Date/Time format, e.g. 2021-11-26T11:30:00.000Z
Values from a Date/Time picker will be in this format, but values from a Date Picker will not.

When using that parameter with a variable the Task requires an actual date/time.

 
Link to comment
Share on other sites

@Steve Giller this is counter-intuitive because the phrase "Expires After", with the manual entry points for Days, Hours, Minutes, implies there is a duration required here; the same for Start and End. Indeed, Victor responded with (ISO 8601) durations for use on a node with "Expires After" naming convention above.

What I think you (Wiki) is saying:

  • When set manually, Start, End and Expires After must be durations counting from the time of the creation of the Task
  • When set as variables, Start, End and Expires After must be specific date/times

I will indeed now try using the outcome from a date/time selector as the input variable to the Expires After; this would work for us.

One remaining question is whether this behaviour is the same of different with the External Authorisation node; does that also need duration for manual and date/time for variable?

Can I please request:

  • The Wiki for External Authorisation also mention the lifespan settings
  • The Human Task node be given a one of the new standard Help buttons to draw this out?

Thanks for helping so far. I'll report back on the findings from using dattime.

Link to comment
Share on other sites

Confirmed it works: when set as variables, the Lifespan Settings on a Human Task (at least for Expires After) must be specific date/times and the value pushed out from the Date/Time selector on a previous Task does work.

image.png.411ca4d1c8033caa33e306b1253b6ebf.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...