Hello
my workflow:
[CrmWorkflowActivity("My Demo workflow")]
public partial class MyDemo : Activity
{
public MyDemo()
{
}
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
try
{
//Debugger.Break();
IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
IWorkflowContext context = contextService.Context;
// Create the CRM service
ICrmService crmService = context.CreateCrmService();
//get all contacts
// QueryExpression query = new QueryExpression();
using (FileStream fileStream = new FileStream(@"C:\inetpub\wwwroot\cwf.log", FileMode.Append))
{
byte[] data = System.Text.Encoding.UTF8.GetBytes(DateTime.Now.ToString());
fileStream.Write(data,0,data.Length);
}
}
catch (Exception exc)
{
throw;
}
return ActivityExecutionStatus.Closed;
}
}
error message:
This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again.
my step is:
1. my workflow: "MyDemo"
2. timeout ,wait 1 minute : Dynamic Value ->Duration -> 1 minute
3. start itself as child workflow
my workflow settings:
Start When : non-checked
Available to Run: checked on Demand, Checked on as a child workflow
i need "infinite loop", just like a scheduler.
please advise how to setup a workflow like a scheduler?
any ideas will be appreciated.