示例#1
0
        private void CreateWorkflowCore(Guid userId, TimeSpan frequency)
        {
            // Create new workflow instance.

            var parameters = new Dictionary <string, object>
            {
                { "UserId", userId },
                { "Delay", frequency },
                { "LastRunTime", DateTime.MinValue },
            };

            WorkflowInstance workflow = CreateWorkflow <Design.PeriodicWorkflow.PeriodicWorkflow>(parameters);

            // Record workflow instance in LinkMe database.

            _worker.AttachWorkflow(userId, workflow.InstanceId);

            // Start running the workflow.

            workflow.Start();
        }