Home      Members   Calendar   Who's On

Welcome Guest ( Login | Register )
      

Home » BPM.NET 2007/Sharepoint Accelerator 2007 » BPM.NET 2007/Sharepoint Accelerator 2007 » Application Development » Apply Calendar in Expression Editor


Apply Calendar in Expression EditorExpand / Collapse
Author
Message
Posted Tuesday, June 09, 2009
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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?
Post #1385
Posted Tuesday, June 09, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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

Post #1388
Posted Wednesday, June 10, 2009
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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.

Post #1389
Posted Wednesday, June 10, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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

Post #1390
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
-
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.

All times are GMT -5:00, Time now is 4:53am

 
Execution: 0.109.10 queries.Compression Enabled.

Copyright © 2002 - 2009 Skelta Software. All rights reserved. Tel: 1 (678) 306 4110 | Email:sales@skelta.com
Skelta - A BPM Workflow Software Company