Question

Repeated activity in the process

Hi!
Some activities in the business process should be repeated at certain time. This is what I do in the script:

var esqActivity = new EntitySchemaQuery(UserConnection.EntitySchemaManager,"Activity");
esqActivity.AddColumn("NextActivityStartDate");
var entities = esqActivity.GetEntity(UserConnection, ActivityUserTask1.CurrentActivityId);
DateTime StartDate = entities.GetTypedColumnValue("NextActivityStartDate");
DateTime Now = DateTime.Now;
TimeSpan ts = StartDate - Now;
ActivityUserTask1.StartIn = (int)ts.TotalHours;
return true;

But the delay works only for the previous task. How can I solve this problem?

File attachments

Like

1 comments

Hello Brian!

Try to create parameter StartIn. In the desired activity set the parameter value ActivityUserTask1.StartIn from the BP parameter StartIn.

And in the script set:

StartIn =  (int)ts.TotalHours;

Show all comments