delayactivity not workfing
質問
I am trying to create a simple sequential workflow using delayactivity. before that i was using hard coded while loop as per : Custom workflow terminates automatically after some time
but now still i am facing issues with delayactivity. if i set it to say 5 minutes , after 5 minutes it still shows in progress . and after around 7 or 8 minutes it breaks saying 'error occured'. the logs are:
01/05/2016 14:55:26.94 OWSTIMER.EXE (0x1D7C) 0x1EA0 SharePoint Foundation Legacy Workflow Infrastructure 88xr Unexpected WinWF Internal Error, terminating workflow Id# 3b4df44c-371d-40ee-887e-a2a832e0b3ea a139529d-0046-30d1-cd87-54e48628d436
01/05/2016 14:55:26.94 OWSTIMER.EXE (0x1D7C) 0x1EA0 SharePoint Foundation Legacy Workflow Infrastructure 98d4 Unexpected System.TypeInitializationException: The type initializer for 'ADCouncil.Core.ADCouncilServiceProvider' threw an exception. ---> System.Exception: Failed to Open ADCouncil configuration section. nsure that your configuration is properly set. at ADCouncil.Core.ADCouncilServiceProvider.LoadConfig() at ADCouncil.Core.ADCouncilServiceProvider..ctor() at ADCouncil.Core.ADCouncilServiceProvider..cctor() --- End of inner exception stack trace --- at ITPCWorkflow.ITPCWorkflow.ITPCWorkflow.codeActivity2_ExecuteCode(Object sender, EventArgs e) at System.Workflow.ComponentModel.Activity.RaiseEvent(DependencyProperty dependencyEvent, Object sender, EventArgs e) at System.Workflow.Activities.CodeActivity.Execute(ActivityExecutionContext executionContext) at System.Workflo... a139529d-0046-30d1-cd87-54e48628d436
01/05/2016 14:55:26.94* OWSTIMER.EXE (0x1D7C) 0x1EA0 SharePoint Foundation Legacy Workflow Infrastructure 98d4 Unexpected ...w.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime) at System.Workflow.Runtime.Scheduler.Run() a139529d-0046-30d1-cd87-54e48628d436
01
I followed some other blogs for the similar issue , i did change the workflow-service timeout as per these blogs : http://the-simple-programmer.blogspot.ae/2012/10/sharepoint-workflow-delay-activity.html https://technet.microsoft.com/en-us/library/cc424946(v=office.12).aspx
it didn't workout . then I followed other blogs and set the cache.ini to 1 removing all of the xml files . still didn't work.
I am using visual studio 2013, workflow manager is installed , 1 front end development server. i am setting the 'delayactivity' time from properties window this way:'00:05:00'.
its just a 3 stage workflow for testing purpose . first activity sends an email to all members , then it should wait for 5 minutes and send another email after 5 minutes .
I am sure its OWSTIMER process issue . but not able to figure out . please suggest something . thanks
解決
In your codeActivity2
, you probably create an instance of class ADCouncilServiceProvider
. According to my understanding, this class needs some special configuration in the .config file of the process running the code. In case of a WF, the hosting process may be:
- W3WP: in that case, the config file is the famous web.config file.
- OWSTIMER.EXE (aka SharePoint Timer service): OWSTIMER hosts the code after a
Delay
activity for example. In that case, the config file isC:\Program Files\Common Files\Microsoft Shared\web server extensions\15\BIN\OWSTIMER.EXE.CONFIG
as I stated in Custom workflow terminates automatically after some time. Note: you need to restart the SharePoint Timer service after modifiying thatOWSTIMER.EXE.CONFIG
file.
[EDIT]
To address your comment about the big picture of your WF:
You have to use a state-machine WF. Maybe with only one main state.
In this main state, at the Init phase, you send emails and create the tasks (I don't see how your x members do approve without tasks ; a task is a communication mean from the users to SharePoint ; you can use other means, but the task is the SharePoint built-in one).
In the Event phase of the state, you listen for two events:
- first the
Delay
. Once the delay has expired: email to who you want, and transition to the final state. - The other event listens to task modifications: each time a user approves, you check whether all users have approved or not. If they've all approved, email to who you want and transition to final state.