| | | Forum Newbie
       
Group: Forum Members Last Login: Monday, November 09, 2009 Posts: 4, Visits: 11 |
| | I would like to set a date variable to today's date plus X days. I would also like to apply a calendar to this calculation (ie. if Sat and Sun are holidays, a Tuesday plus 4 days is a Monday). Is it possible to do this using the Expression Editor? |
| | | | Supreme Being
       
Group: Forum Members Last Login: Monday, May 24, 2010 Posts: 41, Visits: 66 |
| | Hi mneale, Below is the sample Script code which can be used for date manupulations which may be helpful.you can try the same using Expression editor. //Sample CSharp code using System; using Workflow.NET; using Workflow.NET.Engine; public class Script1 { public void Run(int ExecutionId, int ExecutionDetailsId, Workflow.NET.Engine.Context ctx, Action action, string inlink) { DateTime currentreviewdate = Convert.ToDateTime(ctx.Variables["currentreviewprd"].Value); TimeSpan DiffDays; int NoOfdays; DiffDays= System.DateTime.Today.Subtract(currentreviewdate ); NoOfdays= DiffDays.Days; ctx.Variables["numberofdays"].Value = NoOfdays; } } Thanks, Santosh kumar
Santosh Kumar |
| | | | Forum Newbie
       
Group: Forum Members Last Login: Monday, November 09, 2009 Posts: 4, Visits: 11 |
| | Thank you for your reply Santosh, Do you have any sample scripts that would apply the HWS.Calendar to a date manipulation? I would like to perform a date calculation similar to the one a Task Activity performs when it uses the "Timeout for Activity" and "Set Calendar for Timeout" properties to determine when a Task timeout happens. |
| | | | Supreme Being
       
Group: Forum Members Last Login: Monday, May 24, 2010 Posts: 41, Visits: 66 |
| Hi Mneale If your requirement is to set the date time for "Timeout for Activity", then you can make use skelta system variables to achieve the same. Eg: Syntax: ^<Action_Name(Case Sensitive)>_<AcronymOfProperty(Case Insensitive)> For example: For setting variable for Timeout for Action it should be ^Approval1_TFA
Different <AcronymOfProperty> which can be set are: "TFA" : "Timeout for Action" "MATFA" : "Minimum Time for Action" "TWFO" : "Timeout warning for Acknowledgement" "TFO" : "Timeout for Acknowledgement" "TWFA" : "Timeout warning for Action" User need not specify anything in the property. At Runtime this value will be populated to the relevant property of relevant activity. If the user specifies anything in the Property Explicitly, the value entered will override the variable value. If user has a specific date time value, user has to set the DataType of the Variable as date and update the value of this variable from Script Activity or Update Variable Activity. You can manipulate the date as suggested previously and update the same to the variable defined in the above format. Thanks, Santosh Kumar
Santosh Kumar |
| |
|
|