save xoml file without build...

I have a workflow with two custom activities from an activities library.

I run this workflow from another console app. From what i understood, if i change

the order of the activities on th xoml file and save it, the change should take place without building. anyhow, it's not working for me. (I have code activity in the custom activities which print me the activity name so i can see if there is a change in the order.

Any suggestions?

[463 byte] By [amitMerla] at [2007-12-18]
# 1

Hi Amit,

Since you are using activities (Code Activity) that need code beside (compiled code) you need to do the following to get this thing working

1) Create your own type with derives from SequenceActivity and add the required code beside elements and compile it

namespace WorkflowProject1
{

using System;
using
System.ComponentModel;
using
System.ComponentModel.Design;
using
System.Workflow.ComponentModel;
using
System.Workflow.ComponentModel.Design;
using
System.Workflow.Runtime;
using
System.Workflow.Activities.Rules;
using
System.Collections;
using
System.Collections.Generic;
using System.Workflow.Activities;

public partial class Activity1 : System.Workflow.Activities.SequenceActivity{

private void codeActivity1_ExecuteCode(object sender, EventArgs e)
{
Console.WriteLine("Executing Code Activity1"
);
}

private void codeActivity2_ExecuteCode(object sender, EventArgs e)
{
Console.WriteLine("Executing Code Activity2"
);
}
}

2) Create a xoml only workflow (Myworkflow.xoml) with the following code. Note that the type created above is the root activity in this case and refers to the assembly created above.

<ns0:Activity1 x:Name="Activity12" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:WorkflowProject1;Assembly=WorkflowProject1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<CodeActivity x:Name="codeActivity1" ExecuteCode="{ActivityBind Name=Activity12, Path=codeActivity1_ExecuteCode}" />
<CodeActivity x:Name="codeActivity1" ExecuteCode="{ActivityBind Name=Activity12, Path=codeActivity2_ExecuteCode}" />
</ns0:Activity1>

3) Run the workflow from console application

WorkflowRuntime workflowRuntime = new WorkflowRuntime();
TypeProvider t = new
TypeProvider(workflowRuntime);
t.AddAssembly(typeof
(WorkflowProject1.Activity1).Assembly);
workflowRuntime.AddService(t);
AutoResetEvent waitHandle = new AutoResetEvent(false
);
workflowRuntime.WorkflowCompleted += delegate(object
sender, WorkflowCompletedEventArgs e) {waitHandle.Set();};
workflowRuntime.WorkflowTerminated += delegate(object
sender, WorkflowTerminatedEventArgs e)
{
Console
.WriteLine(e.Exception.Message);
waitHandle.Set();
};
try
{
XmlTextReader reader = new XmlTextReader(@"C:\Documents and Settings\All Users\Application Data\WorkflowConsoleApplication1\TextFile1.xoml"
);
WorkflowInstance instance = workflowRuntime.CreateWorkflow(reader);
instance.Start();
waitHandle.WaitOne();
}

catch (WorkflowValidationFailedException exp)
{
ValidationErrorCollection list = exp.Errors;
foreach (ValidationError err in
list)
{
Console
.WriteLine(err.ErrorText);
}
}

Now if you make any changes to your XOML (reverse the order of the code activities, etc..) workflow and save it and run it, you will see the changes reflected without having to compile the xoml.

Basically what we are doing is creating a white box activity in step1 with necessary code beside elements and then adding activities to it in step2 and running it.

Hope this helps.

- Vihang

vihang at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2

I'm using the beta 1 and i cant find the method "WorkflowRuntime.CreateWorkflow".

any help?

amitMerla at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 3

Hi,

I have a similar problem in beta2.

I created a xoml (seq wf with code seperation), added some pre-built activities and tired to load and exec the xoml file in runtime.

something like that:

XmlTextReader xtr = new XmlTextReader("Workflow1.xoml");

WorkflowInstance instance = workflowRuntime.CreateWorkflow(xtr);

instance.Start();

But, i get an exception: "The workflow failed validation" - in the GetRootActivity method.

I guess it has to do something with the note you wrote so i added the TypeProvider (and the assembly) as a service but - nothing (what does it mean anyway ?)

btw - if i used: workflowRuntime.CreateWorkflow(typeof(Workflow1)); it works fine.

btw2 - post build event copies my xoml to destionation dir

Thanks,

Haggai

HaggaiShachar at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4
amitMerla wrote:

I'm using the beta 1 and i cant find the method "WorkflowRuntime.CreateWorkflow".

any help?

You will need to upgrade to Beta2

vihang at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 5

Haggai,

Can you share your xoml only workflow code and I will take a look at it.

Thanks,

Vihang

vihang at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 6
I would like to know if its possible to change an already running .xoml

and make the changes effective in the running workflow without having

to restart the host?

Thanks

Anirshk at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 7

Haggi,

I tried executing the same code for a different workflow that I created using Lab 10 (excercise 4) WWF Beta 2.0 with VS.NET 2005. I have the same error - that 'The workflow failed validation.'. What is interesting is that the InnerException is null. I found that the xtr variable that you are loading is null (at least in my case). This does not make any sense (according to Don Box's article - "Simplify Development with The Declarative Model of Windows Workflow Foundation"). There is something we are doing differently from Don Box but I cannot find out what it is in the article.

Please let me know if anyone has a solution. I share your problems.

Sincerely,

John Portnov

portnovj007@gmail.com

JohnPortnov at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 8

Hi Vihang

In the example showed by you , u said if u change the order of the code activites in the XOML , it will get reflected.

My Question is. if i workflow is running and if i change the xoml by adding one more code activity.. will it still reflect the running workflow

if not how to handle this.

All my modifications are available to me in the new xoml which i want to reflect in the running instance of the workflow. will u tell how to accomplish this. i was trying thisby loading the new workflow form the new xoml and assigning it to the workflow changes object .. but its showing error saying.. a current activity is in initialized state and cannot be removed..

thanks

babu

BABU_NEO at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 9

Hi Amit,

I would like to load the rules xml file, in addition to the xoml file with CreateWorkflow. Do you have any examples of this? The CreateWorkflow overloaded example does not work for me.

Any examples would be appreciated.

Thanks in advance,

John Portnov

JohnPortnov at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 10
I posted on the following thread http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=244324&SiteID=1.
TomLake at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 11

Vihang,

Do you know the xoml syntax required to load a "state" workflow as XOML file without having to recompile the XOML workflow? I am using the following syntax:

--

Dim reader As XmlTextReader = New XmlTextReader("C:\Temp\xoml\Workflow1.xoml")

Dim rulesXML As XmlTextReader = New XmlTextReader("C:\Temp\xoml\Workflow1.rules")

Dim _wfInstance As WorkflowInstance = workflowRuntime.CreateWorkflow(reader, rulesXML, parameters) (there is a validation error on this line)

If (reader.ReadState <> ReadState.Closed) Then reader.Close()

If (rulesXML.ReadState <> ReadState.Closed) Then rulesXML.Close()

<ns2:Activity1 x:Name="Activity12" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns2="clr-namespace:EmailTrackingXOML;Assembly=EmailTrackingXOML, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" InitialStateName="WaitingForEmailState" DynamicUpdateCondition="{x:Null}" CompletedStateName="EmailSentState" xmlns:ns0="clr-namespace:ADPSendEmail;Assembly=ADPSendEmail, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns:ns1="clr-namespace:LoggerActivityLibrary;Assembly=LoggerActivityLibrary, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null">
<StateActivity x:Name="WaitingForEmailState">
<EventDrivenActivity x:Name="EmailCreatedEvent">
<HandleExternalEventActivity Invoked="{ActivityBind Workflow1,Path=EmailCreated_Invoked}" x:Name="EmailCreatedHandleExternalActivity" EventName="EmailCreated" InterfaceType="{x:Type iServeLocalServices.iServeInterface}" />
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_toA1}" x:Name="EmailCreatedSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_name1}" Description="Send Manager notification email" body="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_xfilepath1}" />
<SetStateActivity x:Name="EmailCreatedSetStateActivity" TargetStateName="EmailApprovalState" />
</EventDrivenActivity>
</StateActivity>
<StateActivity x:Name="EmailSentState" />
<StateActivity x:Name="EmailApprovalState">
<EventDrivenActivity x:Name="EmailCancelledEvent">
<HandleExternalEventActivity Invoked="EmailCancelled_Invoked" x:Name="EmailCanceledHandleExternalEventActivity" EventName="EmailCanceled" InterfaceType="{x:Type iServeLocalServices.iServeInterface}">
<HandleExternalEventActivity.ParameterBindings>
<WorkflowParameterBinding ParameterName="e">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderEvtArgs" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
<WorkflowParameterBinding ParameterName="sender">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderSender" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
</HandleExternalEventActivity.ParameterBindings>
</HandleExternalEventActivity>
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_toA1}" x:Name="EmailCancelledSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_name1}" Description="Send Admin email that State WF was cancelled" body="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_xfilepath1}" />
<TerminateActivity x:Name="EmailCanceledTerminateActivity" Error="{ActivityBind Workflow1,Path=emailCancelledError}" />
</EventDrivenActivity>
<EventDrivenActivity x:Name="EmailApprovedEvent">
<HandleExternalEventActivity Invoked="EmailApproved_Invoked" x:Name="EmailApprovedHandleExternalActivity" EventName="EmailApproved" InterfaceType="{x:Type iServeLocalServices.iServeInterface}">
<HandleExternalEventActivity.ParameterBindings>
<WorkflowParameterBinding ParameterName="e">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderEvtArgs" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
<WorkflowParameterBinding ParameterName="sender">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderSender" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
</HandleExternalEventActivity.ParameterBindings>
</HandleExternalEventActivity>
<IfElseActivity x:Name="ifElseActivity1">
<IfElseBranchActivity x:Name="ifValidApproval">
<IfElseBranchActivity.Condition>
<RuleConditionReference ConditionName="Condition1" />
</IfElseBranchActivity.Condition>
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_toA1}" x:Name="EmailApprovedSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_name1}" Description="Send approved email" body="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_xfilepath1}" />
<SetStateActivity x:Name="EmailApprovedSetStateActivity" TargetStateName="EmailSentState" />
</IfElseBranchActivity>
<IfElseBranchActivity x:Name="elseInvalidApproval">
<ns1:LoggerActivity TraceEnabled="True" x:Name="invalidManagerApproval" WFErrorMessage="Manager does not have the right to approve this email." WFEventType="ERROR" WFAppName="EmailXOML" WFErrorSource="Invalid Approval" WFMethodName="ApprovalFailed" WFAcivityName="invalidManagerApproval" WFErrorNumber="11" WFClassName="elseActivitybranch" />
<SetStateActivity x:Name="resetApprovalState" TargetStateName="EmailApprovalState" />
</IfElseBranchActivity>
</IfElseActivity>
</EventDrivenActivity>
<EventDrivenActivity x:Name="EmailRejectedEvent">
<HandleExternalEventActivity Invoked="EmailRejected_Invoked" x:Name="EmailRejectedHandleExternalEventActivity" EventName="EmailRejected" InterfaceType="{x:Type iServeLocalServices.iServeInterface}">
<HandleExternalEventActivity.ParameterBindings>
<WorkflowParameterBinding ParameterName="e">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderEvtArgs" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
<WorkflowParameterBinding ParameterName="sender">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderSender" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
</HandleExternalEventActivity.ParameterBindings>
</HandleExternalEventActivity>
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_toA1}" x:Name="EmailRejectedSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_name1}" Description="Send Admin email that email was rejected" body="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_xfilepath1}" />
<TerminateActivity x:Name="EmailRejectedTerminateActivity" Error="{ActivityBind Workflow1,Path=emailRejectedError}" />
</EventDrivenActivity>
</StateActivity>
</ns2:Activity1>

-

<StateMachineWorkflowActivity x:Class="EmailTrackingXOML.Workflow1" InitialStateName="WaitingForEmailState" x:Name="Workflow1" DynamicUpdateCondition="{x:Null}" CompletedStateName="EmailSentState" xmlns:ns0="clr-namespace:ADPSendEmail;Assembly=ADPSendEmail, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns:ns1="clr-namespace:LoggerActivityLibrary;Assembly=LoggerActivityLibrary, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow">
<StateActivity x:Name="WaitingForEmailState">
<EventDrivenActivity x:Name="EmailCreatedEvent">
<HandleExternalEventActivity Invoked="{ActivityBind Workflow1,Path=EmailCreated_Invoked}" x:Name="EmailCreatedHandleExternalActivity" EventName="EmailCreated" InterfaceType="{x:Type iServeLocalServices.iServeInterface}" />
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_toA1}" x:Name="EmailCreatedSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_name1}" Description="Send Manager notification email" body="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailCreatedSendEmailActivity_xfilepath1}" />
<SetStateActivity x:Name="EmailCreatedSetStateActivity" TargetStateName="EmailApprovalState" />
</EventDrivenActivity>
</StateActivity>
<StateActivity x:Name="EmailSentState" />
<StateActivity x:Name="EmailApprovalState">
<EventDrivenActivity x:Name="EmailCancelledEvent">
<HandleExternalEventActivity Invoked="EmailCancelled_Invoked" x:Name="EmailCanceledHandleExternalEventActivity" EventName="EmailCanceled" InterfaceType="{x:Type iServeLocalServices.iServeInterface}">
<HandleExternalEventActivity.ParameterBindings>
<WorkflowParameterBinding ParameterName="e">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderEvtArgs" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
<WorkflowParameterBinding ParameterName="sender">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderSender" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
</HandleExternalEventActivity.ParameterBindings>
</HandleExternalEventActivity>
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_toA1}" x:Name="EmailCancelledSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_name1}" Description="Send Admin email that State WF was cancelled" body="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailCancelledSendEmailActivity_xfilepath1}" />
<TerminateActivity x:Name="EmailCanceledTerminateActivity" Error="{ActivityBind Workflow1,Path=emailCancelledError}" />
</EventDrivenActivity>
<EventDrivenActivity x:Name="EmailApprovedEvent">
<HandleExternalEventActivity Invoked="EmailApproved_Invoked" x:Name="EmailApprovedHandleExternalActivity" EventName="EmailApproved" InterfaceType="{x:Type iServeLocalServices.iServeInterface}">
<HandleExternalEventActivity.ParameterBindings>
<WorkflowParameterBinding ParameterName="e">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderEvtArgs" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
<WorkflowParameterBinding ParameterName="sender">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderSender" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
</HandleExternalEventActivity.ParameterBindings>
</HandleExternalEventActivity>
<IfElseActivity x:Name="ifElseActivity1">
<IfElseBranchActivity x:Name="ifValidApproval">
<IfElseBranchActivity.Condition>
<RuleConditionReference ConditionName="Condition1" />
</IfElseBranchActivity.Condition>
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_toA1}" x:Name="EmailApprovedSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_name1}" Description="Send approved email" body="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailApprovedSendEmailActivity_xfilepath1}" />
<SetStateActivity x:Name="EmailApprovedSetStateActivity" TargetStateName="EmailSentState" />
</IfElseBranchActivity>
<IfElseBranchActivity x:Name="elseInvalidApproval">
<ns1:LoggerActivity TraceEnabled="True" x:Name="invalidManagerApproval" WFErrorMessage="Manager does not have the right to approve this email." WFEventType="ERROR" WFAppName="EmailXOML" WFErrorSource="Invalid Approval" WFMethodName="ApprovalFailed" WFAcivityName="invalidManagerApproval" WFErrorNumber="11" WFClassName="elseActivitybranch" />
<SetStateActivity x:Name="resetApprovalState" TargetStateName="EmailApprovalState" />
</IfElseBranchActivity>
</IfElseActivity>
</EventDrivenActivity>
<EventDrivenActivity x:Name="EmailRejectedEvent">
<HandleExternalEventActivity Invoked="EmailRejected_Invoked" x:Name="EmailRejectedHandleExternalEventActivity" EventName="EmailRejected" InterfaceType="{x:Type iServeLocalServices.iServeInterface}">
<HandleExternalEventActivity.ParameterBindings>
<WorkflowParameterBinding ParameterName="e">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderEvtArgs" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
<WorkflowParameterBinding ParameterName="sender">
<WorkflowParameterBinding.Value>
<ActivityBind Name="Workflow1" Path="OrderSender" />
</WorkflowParameterBinding.Value>
</WorkflowParameterBinding>
</HandleExternalEventActivity.ParameterBindings>
</HandleExternalEventActivity>
<ns0:ADPWSSendEmail toA="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_toA1}" x:Name="EmailRejectedSendEmailActivity" subj="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_subj1}" name="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_name1}" Description="Send Admin email that email was rejected" body="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_body1}" fromA="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_fromA1}" xfilepath="{ActivityBind Workflow1,Path=EmailRejectedSendEmailActivity_xfilepath1}" />
<TerminateActivity x:Name="EmailRejectedTerminateActivity" Error="{ActivityBind Workflow1,Path=emailRejectedError}" />
</EventDrivenActivity>
</StateActivity>
</StateMachineWorkflowActivity>

--

Both xoml formats do not work. Any suggestions on where to find the documentation on correct xoml formats for state workflows?

Sincerely,

John Portnov

John Portnov

JohnPortnov at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 12

Babu,

The xoml is read when you create the workflow instance. Once you have created it, the isntance runs independant of the changes to the xoml file. Hence even if you update the xoml, the running instance isnt affected.

Also, we cannot dynamically remove an executing activity. Hence you would not be able to replace the entire workflow by using dynamic update (since the workflow is running).

The way you could make your scenario work is by doing a deseriliazing the new xoml and for every activity in the new xoml's workflow, checking to see if it is present in the running workflow. If it isnt, then you could insert it to the TransientWorkflow in the WorkflowChanges object.

Thanks,

Vijay

VijaySubramani at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 13
Check out the post Xoml activation and how to use it on my blog.
TomLake at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified