workflow-foundation-4

Accessing Arguments, Workflow Variables from custom activities

偶尔善良 提交于 2019-12-08 19:19:29
I have a workflow composed of many custom activities. All these activities need to access startup arguments of the workflow itself. I can define InArgument inside all these custom activities and bind the workflow arguments to custom activity arguments but I am not comfortable with this solution. What is the best way to access workflow level argument and variable declarations from custom activities. Can I get them from ActivityContext? Thanks. One way we've looked at this with our custom activities is using the Properties property available in the ActivityContext. We have an activity with an

WF 4.5 Bookmarked custom activity not fire persist/unload

柔情痞子 提交于 2019-12-08 10:56:29
问题 I've an application that host WF4.5 workflow in IIS using WorkflowServiceHost, WorkflowServiceHostFactory and WorkflowHostingEndpoint. The workflow is defined by VS 2013 in a .xaml file. In the workflow a have a custom activity for receive input data from a user. Get that using CreateBookmark and the callback for Resume. My problem is: The first activity execute and the workflow instance goes to idle, persist and unload. After resuming the first bookmark the second activity execute an the

WF4 State machine + bookmarks

最后都变了- 提交于 2019-12-08 09:31:34
问题 I ve been searching a good simple sample for WF4 (or higher) state machine with resume (possibly BookMarks from the docs I ve read). I would like to see how can I implement a state machine that is able to resume at any given state inside a WF. Since I don't know anything about WF, I would like to see a simple state machine where I can resume the exceution at the state it was last time and it would also be nice to see how to 'force' a WF to jump to a state and re-start from there (if possible)

WF4 hosting conversion of self hosting console app to service hosted in IIS

三世轮回 提交于 2019-12-08 09:07:24
问题 I have a console application project which is a workflow service self hosted using WorkflowServiceHost. It contains a flowchart workflow definition (xaml) and some custom activities in cs files. This application connects (via a service reference) to a WCF data service hosted as .svc. I have an aspnet web app that interacts with the workflow service via a service ref. It's all working fine. I'd like to convert the workflow service console app to instead be hosted on IIS (I'm developing using

Where to host Windows Workflow Foundation engine?

不问归期 提交于 2019-12-08 08:24:46
问题 Is there any guideline to make the decision where to host WF: in our own custom windows NT service or inside IIS? 回答1: You have the option of 3 different runtimes, WorkflowInvoker, WorkflowApplication and WorkflowServiceHost. In the last case the AppFabrik running on IIS/WAS is a generic host you can use. In general that would be a good choice when doing worklfow services. 来源: https://stackoverflow.com/questions/2856353/where-to-host-windows-workflow-foundation-engine

Declare Variable<T> variable in a CodeActivity in windows workflow 4.0

时光总嘲笑我的痴心妄想 提交于 2019-12-08 03:58:31
问题 I am new to windows workflow and trying to get my head round variables, the following code gives me an error - public sealed class CodeActivity1 : CodeActivity { Variable<int> wfVar = new Variable<int>("wfVar", 0); protected override void Execute(CodeActivityContext context) { wfVar.Set(context, 1); } } Variable 'wfVar' of type 'System.Int32' cannot be used. Please make sure it is declared in an Activity or SymbolResolver. What does the error mean, considering that I have declared the

Where to host Windows Workflow Foundation engine?

无人久伴 提交于 2019-12-08 03:38:27
Is there any guideline to make the decision where to host WF: in our own custom windows NT service or inside IIS? You have the option of 3 different runtimes, WorkflowInvoker, WorkflowApplication and WorkflowServiceHost. In the last case the AppFabrik running on IIS/WAS is a generic host you can use. In general that would be a good choice when doing worklfow services. 来源: https://stackoverflow.com/questions/2856353/where-to-host-windows-workflow-foundation-engine

Validate an Activity from within an ActivityDesigner?

久未见 提交于 2019-12-07 20:40:24
问题 I'd like to validate the workflow within the design surface (in this case, Visual Studio) from within one of the child Activities' designer. I'd like to prevent users from moving forward until other errors are corrected in order to simplify the design experience later down the road. The naiive implementation doesn't work: var activity = (this.ModelItem.Root.GetCurrentValue() as ActivityBuilder) .Implementation as Activity; var validationResult = ActivityValidationServices.Validate(activity);

Resuming a persisted Window Workflow 4 Activity without knowing concrete type of activity

亡梦爱人 提交于 2019-12-07 19:26:09
问题 I am trying to understand how one can resume (load) a previously persisted WF4 activity without knowing the concrete type of the activity. In order to load a persisted activity, I not only need its workflowId (which I have), but I need to pass in an instance of the activity too - so I need to know it's type: var workflowApplication = new WorkflowApplication(activity); // what type is activity? workflowApplication.Load(workflowId); The problem is that it could be one of a number of types -

Trying to get to the bottom of a Windows Workflow 4.5 issue

烈酒焚心 提交于 2019-12-07 09:03:17
问题 The error I am getting is "The WorkflowApplication has been aborted because a Load or LoadRunnableInstance operation threw an exception. Create a new WorkflowApplication object to try loading another workflow instance." I am using "workflowapplication" to run the workflow. The workflow instance I'm trying to load (there are a few of them) were created sometime ago and were persisted into the database. Is there a way to find the exception that was actually thrown during Load or