Answered

Getting out of range while I'm adding the date by passing the number of days.

hi,

Im using Bizagi 10.7 Im getting out of range while I get the date by passing no of days as argument.

What is the range we can pass in addDays method.

Im able to pass a six digit integer value to add days method and if I pass more than that Im getting the error as below

Help is greatly appreciated.

Comments (5)

photo
1

Dear Seenivasagan,

Regarding your question, add days is a .Net function. For further information: http://help.bizagi.com/bpm-suite/en/index.html?date_operations.htm. For example:

Suppose that the last activity in a Vacation Request process must be completed within five days after the employee has returned from his/her vacations.

To calculate the completion due date, five days must be added to the value of the relevant data model attribute.

We will use a .NET function that allow us to add days to an attribute or variable:

  • ResultingDate=Date.AddDays(Value);

Other .NET date functions allow the addition of hours, months or years:

  • ResultingDate=Date.AddHours(Value);
  • ResultingDate=Date.AddMonths(Value);
  • ResultingDate=Date.AddYears(Value);

If you wish to subtract hours, days, months or years then add negative values:

  • ResultingDate=Date.AddDays(-Value);

Regards

photo
1

Hi,

I've asked what is the maximum duration that can be passed in that method.

Please find the error message i provided if i passed 6 digits in the question.

if i pass above the duration it is throwing error message.

Please tell me what is the maximum duration that can be passed in that method.

Thanks

photo
1

Dear Seenivasagan,
Regarding your question, AddDays is a C# function which receives a Double attribute. For further information: https://msdn.microsoft.com/en-us/library/system.datetime.adddays(v=vs.110).aspx

  1. public DateTime AddDays(double value)










Parameters

valueType: System.Double
A number of whole and fractional days. The value parameter can be negative or positive.


Return Value

Type: System.DateTime
An object whose value is the sum of the date and time represented by this instance and the number of days represented by value.
Regards

photo
1

Thanks a lot

I'm using java version of bizagi,

If I'm not wrong Still the same method will be applicable here .

Thanks

photo
1

Dear Seenivasagan,

We have created a project and tried to reproduce, but it worked correctly. We have used this script:


  1. var currentDate = <dateEval.dateOne>
  2. var nextDate = currentDate.AddDays(<dateEval.daysNumber>);
  3. CHelper.trace("DateLog","nextDate: "+nextDate)
  4. <dateEval.dateTwo> = nextDate;



Using this example, we were able to get an initial date and receive a number of days to be added to this date without problems.The trace shows the correct date.


Regards

photo