Windows Workflow Foundation 3


Binding in XOML only workflows?


Tom,
I have converted a State Workflow to XOML only State workflow.  It seems that the HandleExternalEvent activity does not set OrderSender object to a value.  As a result sender parameter is null, but the e parameter is not null.  This was not the case prior to converting the State workflow to XOML only workflow.  Please review the XOML syntax and let me know if the binding syntax for OrderSender is not correct?
---------------------------------------------------------------------
<ns0:BaseOrderWorkflow EmailCancelledSendEmailActivity_EmailBody="{p1:Null}" GetAddressMainframeActivity_RegionID="{p1:Null}" GetAddressMainframeActivity_LocationID="{p1:Null}" RegionID="{p1:Null}" DynamicUpdateCondition="{p1:Null}" EmailApprovedSendEmailActivity_FromName="{p1:Null}" EmailCreatedSendEmailActivity_ToEmail="{p1:Null}" EmailRejectedSendEmailActivity_FromName="{p1:Null}" x:Name="XOMLEmailWorkflow" EmailCreatedSendEmailActivity_EmailSubject="{x:Null}" FromEmail="{x:Null}" ToEmail="{x:Null}" EmailCancelledSendEmailActivity_FromEmail="{x:Null}" EmailApprovedSendEmailActivity_ToEmail="{x:Null}" CompanyCode="{x:Null}" EmailApprovedSendEmailActivity_EmailSubject="{x:Null}" GetAddressMainframeActivity_MRSchedule="{x:Null}" LocationID="{x:Null}" EmailCancelledSendEmailActivity_FromName="{x:Null}" EmailCancelledSendEmailActivity_ToEmail="{x:Null}" FromName="{x:Null}" EmailCreatedSendEmailActivity_FromName="{x:Null}" EmailCreatedSendEmailActivity_FromEmail="{x:Null}" ToEmailAdmin="{x:Null}" MRSchedule="{x:Null}" EmailCancelledSendEmailActivity_EmailSubject="{x:Null}" ToEmailManager="{x:Null}" EmailRejectedSendEmailActivity_ToEmail="{x:Null}" EmailSubject="{x:Null}" EmailBody="{x:Null}" EmailRejectedSendEmailActivity_EmailSubject="{x:Null}" EmailRejectedSendEmailActivity_FromEmail="{x:Null}" InitialStateName="WaitingForEmailState" EmailApprovedSendEmailActivity_EmailBody="{x:Null}" GetAddressMainframeActivity_CompanyCode="{x:Null}" EmailCreatedSendEmailActivity_EmailBody="{x:Null}" CompletedStateName="EmailSentState" EmailApprovedSendEmailActivity_FromEmail="{x:Null}" EmailRejectedSendEmailActivity_EmailBody="{x:Null}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" xmlns:ns1="clr-namespace:ADPSendEmail;Assembly=ADPSendEmail, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns:ns2="clr-namespace:MainframeActivity;Assembly=MainframeActivity, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:p1="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:XOMLEmailWorkflowLibrary1;Assembly=XOMLEmailWorkflowLibrary1, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null"> <StateActivity x:Name="WaitingForEmailState">  <EventDrivenActivity x:Name="EmailCreatedEvent">   <HandleExternalEventActivity Invoked="{ActivityBind XOMLEmailWorkflow,Path=EmailCreated_Invoked}" x:Name="EmailCreatedHandleExternalActivity" EventName="EmailCreated" InterfaceType="{x:Type p12:IOrderService,TypeName=OrderLocalServices.IOrderService}" xmlns:p12="clr-namespace:OrderLocalServices;Assembly=XOMLEmailWorkflowLibrary1, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" />   <IfElseActivity x:Name="CheckSourceEmail">    <IfElseBranchActivity x:Name="ifValidSender">     <IfElseBranchActivity.Condition>      <RuleConditionReference ConditionName="Condition1" />     </IfElseBranchActivity.Condition>     <CodeActivity x:Name="ValidSenderEmailAddress" ExecuteCode="{ActivityBind XOMLEmailWorkflow,Path=ValidSender}" />    </IfElseBranchActivity>    <IfElseBranchActivity x:Name="ifInvalidSender">     <CodeActivity x:Name="InvalidSenderEmailAddress" ExecuteCode="{ActivityBind XOMLEmailWorkflow,Path=InvalidSender}" />    </IfElseBranchActivity>   </IfElseActivity>   <ns1:ADPWSSendEmail toA="{ActivityBind XOMLEmailWorkflow,Path=EmailCreatedSendEmailActivity_ToEmail}" x:Name="EmailCreatedSendEmailActivity" subj="{ActivityBind XOMLEmailWorkflow,Path=EmailCreatedSendEmailActivity_EmailSubject}" name="{ActivityBind XOMLEmailWorkflow,Path=EmailCreatedSendEmailActivity_FromName}" Description="Send Manager email notification" body="{ActivityBind XOMLEmailWorkflow,Path=EmailCreatedSendEmailActivity_EmailBody}" fromA="{ActivityBind XOMLEmailWorkflow,Path=EmailCreatedSendEmailActivity_FromEmail}" xfilepath="{x:Null}" />   <SetStateActivity x:Name="EmailCreatedSetStateActivity" TargetStateName="EmailApprovalState" />  </EventDrivenActivity> </StateActivity> <StateActivity x:Name="EmailApprovalState">  <EventDrivenActivity x:Name="EmailApprovedEvent">   <HandleExternalEventActivity Invoked="{ActivityBind XOMLEmailWorkflow,Path=EmailApproved_Invoked}" x:Name="EmailApprovedHandleExternalActivity" EventName="EmailApproved" InterfaceType="{x:Type p12:IOrderService,TypeName=OrderLocalServices.IOrderService}" xmlns:p12="clr-namespace:OrderLocalServices;Assembly=XOMLEmailWorkflowLibrary1, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null">    <HandleExternalEventActivity.ParameterBindings>     <WorkflowParameterBinding ParameterName="sender">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderSender" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>     <WorkflowParameterBinding ParameterName="e">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderEvtArgs" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>    </HandleExternalEventActivity.ParameterBindings>   </HandleExternalEventActivity>   <ns1:ADPWSSendEmail toA="{ActivityBind XOMLEmailWorkflow,Path=EmailApprovedSendEmailActivity_ToEmail}" x:Name="EmailApprovedSendEmailActivity" subj="{ActivityBind XOMLEmailWorkflow,Path=EmailApprovedSendEmailActivity_EmailSubject}" name="{ActivityBind XOMLEmailWorkflow,Path=EmailApprovedSendEmailActivity_FromName}" Description="Send approved email" body="{ActivityBind XOMLEmailWorkflow,Path=EmailApprovedSendEmailActivity_EmailBody}" fromA="{ActivityBind XOMLEmailWorkflow,Path=EmailApprovedSendEmailActivity_FromEmail}" xfilepath="{x:Null}" />   <SetStateActivity x:Name="EmailApprovedSetStateActivity" TargetStateName="EmailSentState" />  </EventDrivenActivity>  <EventDrivenActivity x:Name="MainframeAddressRetrievedEvent">   <HandleExternalEventActivity Invoked="{ActivityBind XOMLEmailWorkflow,Path=MainframeAddressRetrieved_Invoked}" x:Name="AddressApprovedHandleExternalActivity" EventName="MainframeAddressRetrieved" InterfaceType="{x:Type p12:IOrderService,TypeName=OrderLocalServices.IOrderService}" xmlns:p12="clr-namespace:OrderLocalServices;Assembly=XOMLEmailWorkflowLibrary1, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null">    <HandleExternalEventActivity.ParameterBindings>     <WorkflowParameterBinding ParameterName="sender">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderSender" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>     <WorkflowParameterBinding ParameterName="e">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderEvtArgs" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>    </HandleExternalEventActivity.ParameterBindings>   </HandleExternalEventActivity>   <ns2:GetMainframeData x:Name="getMainframeData1" mCompanyCode="{ActivityBind XOMLEmailWorkflow,Path=GetAddressMainframeActivity_CompanyCode}" mMRSchedule="{ActivityBind XOMLEmailWorkflow,Path=GetAddressMainframeActivity_MRSchedule}" mLocationID="{ActivityBind XOMLEmailWorkflow,Path=GetAddressMainframeActivity_LocationID}" mRegionID="{ActivityBind XOMLEmailWorkflow,Path=GetAddressMainframeActivity_RegionID}" />   <SetStateActivity x:Name="AddressSetStateActivity" TargetStateName="EmailSentState" />  </EventDrivenActivity>  <EventDrivenActivity x:Name="EmailRejectedEvent">   <HandleExternalEventActivity Invoked="{ActivityBind XOMLEmailWorkflow,Path=EmailRejected_Invoked}" x:Name="EmailRejectedHandleExternalEventActivity" EventName="EmailRejected" InterfaceType="{x:Type p12:IOrderService,TypeName=OrderLocalServices.IOrderService}" xmlns:p12="clr-namespace:OrderLocalServices;Assembly=XOMLEmailWorkflowLibrary1, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null">    <HandleExternalEventActivity.ParameterBindings>     <WorkflowParameterBinding ParameterName="sender">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderSender" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>     <WorkflowParameterBinding ParameterName="e">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderEvtArgs" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>    </HandleExternalEventActivity.ParameterBindings>   </HandleExternalEventActivity>   <ns1:ADPWSSendEmail toA="{ActivityBind XOMLEmailWorkflow,Path=EmailRejectedSendEmailActivity_ToEmail}" x:Name="EmailRejectedSendEmailActivity" subj="{ActivityBind XOMLEmailWorkflow,Path=EmailRejectedSendEmailActivity_EmailSubject}" name="{ActivityBind XOMLEmailWorkflow,Path=EmailRejectedSendEmailActivity_FromName}" Description="Send Admin notice that Email approval was rejected" body="{ActivityBind XOMLEmailWorkflow,Path=EmailRejectedSendEmailActivity_EmailBody}" fromA="{ActivityBind XOMLEmailWorkflow,Path=EmailRejectedSendEmailActivity_FromEmail}" xfilepath="{x:Null}" />   <TerminateActivity x:Name="EmailRejectedTerminateActivity" Error="{ActivityBind XOMLEmailWorkflow,Path=EmailRejectedError}" />  </EventDrivenActivity>  <EventDrivenActivity x:Name="EmailCancelledEvent">   <HandleExternalEventActivity Invoked="{ActivityBind XOMLEmailWorkflow,Path=EmailCancelled_Invoked}" x:Name="EmailCancelledHandleExternalEventActivity" EventName="EmailCancelled" InterfaceType="{x:Type p12:IOrderService,TypeName=OrderLocalServices.IOrderService}" xmlns:p12="clr-namespace:OrderLocalServices;Assembly=XOMLEmailWorkflowLibrary1, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null">    <HandleExternalEventActivity.ParameterBindings>     <WorkflowParameterBinding ParameterName="sender">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderSender" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>     <WorkflowParameterBinding ParameterName="e">      <WorkflowParameterBinding.Value>       <ActivityBind Name="XOMLEmailWorkflow" Path="OrderEvtArgs" />      </WorkflowParameterBinding.Value>     </WorkflowParameterBinding>    </HandleExternalEventActivity.ParameterBindings>   </HandleExternalEventActivity>   <ns1:ADPWSSendEmail toA="{ActivityBind XOMLEmailWorkflow,Path=EmailCancelledSendEmailActivity_ToEmail}" x:Name="EmailCancelledSendEmailActivity" subj="{ActivityBind XOMLEmailWorkflow,Path=EmailCancelledSendEmailActivity_EmailSubject}" name="{ActivityBind XOMLEmailWorkflow,Path=EmailCancelledSendEmailActivity_FromName}" Description="Send Admin notice that Email State WF was cancelled" body="{ActivityBind XOMLEmailWorkflow,Path=EmailCancelledSendEmailActivity_EmailBody}" fromA="{ActivityBind XOMLEmailWorkflow,Path=EmailCancelledSendEmailActivity_FromEmail}" xfilepath="{x:Null}" />   <TerminateActivity x:Name="EmailCancelledTerminateActivity" Error="{ActivityBind XOMLEmailWorkflow,Path=EmailCancelledError}" />  </EventDrivenActivity> </StateActivity> <StateActivity x:Name="EmailSentState" /></ns0:BaseOrderWorkflow>
-----------------------------------------------------------------------------------------------------------------------
Thanks in advance,
John Portnov
 John Portnov wrote:
I have converted a State Workflow to XOML only State workflow.  It seems that the HandleExternalEvent activity does not set OrderSender object to a value.  As a result sender parameter is null, but the e parameter is not null.  This was not the case prior to converting the State workflow to XOML only workflow. 
 John Portnov wrote:
I have converted a State Workflow to XOML only State workflow.  It seems that the HandleExternalEvent activity does not set OrderSender object to a value.  As a result sender parameter is null, but the e parameter is not null.  This was not the case prior to converting the State workflow to XOML only workflow. 
Tom,
I am using WWF Beta 2.2 XOML only workflows.  When I created the same State workflow in WWF Beta 2.2 as code workflow, the sender was not null.
 
John Portnov

Related Links

Global Run Time Variable
To use dependency properties or not
OwnershipTimeoutSeconds
Problem in WorkflowRuntime.WorkflowCompleted event
HandleExternalEvent Problem
WWF with .NET compact framework 2.0
How can I query StateMachineWorkflowInstance before the WF idles
Question about modifying a workflow
Rule Conditions against custom activities and XAML activation - how should I achieve this?
MOSS Publishing Site
WF custom persistence once again
Hands on Labs 2.2
WF Virgin
Error in the Hands on lab 09
Workflow Designer
How do you load XOML only State Workflow in WFPad for WWFBeta 2.2 (with namespace for codebehind assembly, and activities)?

Categories

MSDN
Data Platform Development
Smart Device Development
ScriptJunkie
Archived Forums #
Archived Forums A-B
Archived Forums I-L
Archived Forums SA-SM
Software Entwicklung f...
Announcements for all ...
Forums Redesign - Q&A ...
Suggestions and Feedba...
MSDN and TechNet Profi...
Visual C#
Parallel Computing in ...
Visual Studio LightSwi...
Visual Studio Code Vis...
Visual Studio Tools fo...
Visual Studio Graphics...
XboxLiveDevelopment
Windows Desktop Develo...
Windows Desktop Search...
Windows Desktop Winsoc...
Outlook for Developers
Office 365 for Developers
SharePoint 2013 - Gene...
SharePoint 2013 - Usin...
SharePoint 2010 - Setu...
SharePoint Legacy Vers...
SharePoint Legacy Vers...
Azure Active Directory
Azure Multi-Factor Aut...
Azure Mobile Apps
Azure Cache
Azure CDN
Azure Functions
Azure Log Integration
Visual Studio Visualiz...
BizTalk Server General
BizTalk Server RFID
LINQ to SQL
Reactive Extensions (Rx)
The Forum of Sho
Visual Basic for Appli...
Training and Certifica...
SyncFx – Microsoft Syn...
Microsoft Robotics - S...
Microsoft Robotics - H...
.NET Compact Framework
SQL Server XML
Database Mirroring
SQL Server Express
Power Pivot
SQL Server Data Qualit...
Windows Embedded 8.1 I...
SQL Server 2012 Setup ...
SQL Server 2012 Master...
Windows Forms Designer
Windows Live Writer: D...
MSDN Magazine
Bing Maps for Windows ...
Exchange Server Protocols
Office Protocols
Project Customization ...
Silverlight 4
MVVM / ViewModel Patte...
Game Development with ...
Designing with Silverl...
Expression Design
Microsoft Security Dev...
Retired InfoPath Forms...
Retired SharePoint Wor...
Retired SharePoint Soc...
Azure Startups
App Producer (archived)
CAT.NET
Charts & Reports in th...
Commerce Server 2002 a...
Expression Community S...
LINQ to SQL (Pre-Release)
Microsoft Security Dev...
Microsoft Unified Comm...
Monitor, Alert and Aut...
Regular Expressions
Search Server: Federation
Search Server: Known B...
Silverlight (formerly ...
Security for Azure
SQL Server Modeling
SQL Server 2014 High A...
SQL Server 2014 Analys...
SQL Server 2014 In-Mem...
Tools for Windows Stor...
Visual Basic IDE
Visual C# Express Edition
Visual Studio Database...
Visual Studio Performa...
Web Development in Vis...
Windows Live Controls ...
Windows MultiPoint Mou...
Windows MultiPoint Mou...
Windows SideShow Devel...
Working with Data and ...
XML in Visual Studio 2...
XML in Visual Studio a...
Microsoft R Open
Open source Developmen...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile