Windows Workflow Foundation 3


ExpenseReport Sample Cancle Approval Question


Recently,I study the ExpenseReport sample. I have a question about that: The manager first approves it,then he want to cancel his approval,how to deal with this kind of situation.
Thanks in advance
Hi,
In a scenario like that, one way would be to have an additional review point later in the workflow to allow the manager to confirm their approval.
Another way is after the manager has completed his approval, you could put the remainder of the workflow into a ConditionedActivityGroup, and have one of the children be a HandleExternalEvent that is listening for a Manager Cancel event. If this event is received, youc ould cancel the execution of the currently executing children and then continue execution with the newly canceled status.
Another way would be to have the manager be able to view the progress of the workflow, and if it has not yet completed, you could use Dynamic update and WorkflowChanges to modify the running workflow so that it would behave in the desired fashion (cancel after the fact)
Do any of these choices sound like they might work for you?
Steve Danielson [Microsoft]This posting is provided "AS IS" with no warranties, and confers no rights.
To implement the scenario that you describe, it sounds like your workflow could follow this model
"A" approves report, then "B", then "C". But, each manager can "recall" the report back to their approval state if the next manager has not completed their review.
There would be two events, "ManagerDecision (either Approve or Reject) and ManagerRecall (or 3 events - ManagerApprove, ManagerReject, ManagerRecall"
The State for Manager "A" would handle 2 events: ManagerApprove and ManagerReject. Once the Report is approved, the workflow could transition to the state for Manager "B" which would listen for 3 events: ManagerApprove, ManagerReject, ManagerRecall. The User Interface for your managers would give Manager A a way to fire the ManagerRecall event if Manager "B" has not yet approved or rejected.
This would be a way to do this if you wanted to build all the logic into the workflow itself.
Does that work for you, or were you needing a more arbitrary way to do it without needing to build it into the workflow?
Steve Danielson [Microsoft]This posting is provided "AS IS" with no warranties, and confers no rights.
Hi,
In a scenario like that, one way would be to have an additional review point later in the workflow to allow the manager to confirm their approval.
Another way is after the manager has completed his approval, you could put the remainder of the workflow into a ConditionedActivityGroup, and have one of the children be a HandleExternalEvent that is listening for a Manager Cancel event. If this event is received, youc ould cancel the execution of the currently executing children and then continue execution with the newly canceled status.
Another way would be to have the manager be able to view the progress of the workflow, and if it has not yet completed, you could use Dynamic update and WorkflowChanges to modify the running workflow so that it would behave in the desired fashion (cancel after the fact)
Do any of these choices sound like they might work for you?
Steve Danielson [Microsoft]This posting is provided "AS IS" with no warranties, and confers no rights.
Thank you,Steve.
Sorry I don't explain that clearly.
I mean in a common scenario,Manager A approves the report,then Manager B approve,and then Manager C,so on. First,A approve the report.Later for some reason like that he clicked wrong,or finds some promblem later,if B hasn't approve the report,I think A may want to cancle his review,and think over about the report.Maybe he will approve or reject it next time,this mean the step go back to the begin state,the report is waiting for A to approve it or reject it.The workfow is not finished.B or C face the same scenario,if the next reviewer not review,he want to have the ablitity to cancel his review and have a new choose.
I was puzzled about this: Should this scenario use the state workflow or use Dynamic update and WorkflowChanges to modify the running workflow so that it would behave in the desired fashion (cancel after the fact) as you said?
If as you said how to do that .It's appreciated to give some example,thanks again.
To implement the scenario that you describe, it sounds like your workflow could follow this model
"A" approves report, then "B", then "C". But, each manager can "recall" the report back to their approval state if the next manager has not completed their review.
There would be two events, "ManagerDecision (either Approve or Reject) and ManagerRecall (or 3 events - ManagerApprove, ManagerReject, ManagerRecall"
The State for Manager "A" would handle 2 events: ManagerApprove and ManagerReject. Once the Report is approved, the workflow could transition to the state for Manager "B" which would listen for 3 events: ManagerApprove, ManagerReject, ManagerRecall. The User Interface for your managers would give Manager A a way to fire the ManagerRecall event if Manager "B" has not yet approved or rejected.
This would be a way to do this if you wanted to build all the logic into the workflow itself.
Does that work for you, or were you needing a more arbitrary way to do it without needing to build it into the workflow?
Steve Danielson [Microsoft]This posting is provided "AS IS" with no warranties, and confers no rights.

Related Links

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)?
invoke sub StateMachine workflow
Using WWF to model and support "Tech Trees" in RTS games
RuleConditionDialog and intellisense
Workflow Persistence & Event Arguments
PersistenceService - Transaction Timeout
SimpleExpenseReport
SQLTrackingQuery from Workflow
CreateWorkflow failing validation
xbox live mic help
download code samples of Microsoft press' windows workflow foundation step by step - Kenn Scribner
Advantage and disadvantage of ASP.NET WorkFl
When do activities CANCEL and How do i force activities to cancel state?

Categories

MSDN
Windows Phone Dev Center
BizTalk Server
Data Platform Developm...
Learning
Microsoft Sync Framework
Windows Server
Orchard
Bing
WebsitePanel
Bing Ads API: Development
Other Forums
Archived Forums A-B
Archived Forums E-H
Archived Forums W
Parallel Computing in ...
Visual F#
XboxLiveDevelopment
Windows Desktop Optica...
Windows Desktop Search...
Windows Filtering Plat...
Access for Developers
Office 365 for Developers
SharePoint 2013 - Setu...
SharePoint 2010 - Gene...
Azure Management Portal
Azure Automation
Azure Search
Azure Marketplace
Azure Scripting and Co...
Azure DocumentDB
Azure App Service - AP...
Cognitive Services
Azure Database for MySQL
Team Foundation Server...
BizTalk Server RFID
BizTalk ESB Toolkit
Debugger Canvas
JScript Native
Internet Explorer Exte...
Visual Basic for Appli...
Microsoft Robotics - D...
SQL Server Reporting S...
.NET Framework inside ...
SQL Service Broker
SQL Server Migration
Standard 2009: Compone...
Standard 7: Components...
Windows Embedded Compa...
Windows Forms General
Windows Live General: ...
Dynamics 365 for Custo...
Orchard –Discussions
WebsitePanel - Discuss...
Known Issues for Windo...
Bing Maps General
Bing Maps WPF, WP7/8/8...
Bing Maps REST, SOAP, ...
Exchange Server Protocols
Project Server - Setup...
Microsoft Lync Client ...
Microsoft Lync Server ...
Silverlight Installati...
Managed Extensibility ...
Silverlight Video and ...
Retired SharePoint Acc...
Acropolis
ADO.NET Entity Framewo...
CAT.NET
Direct3D 10
Doloto
Chart Controls for .NE...
Face Tracking – Kinect...
Managed Extensibility ...
Microsoft Unified Comm...
Moderator Posting Only...
Microsoft "Data Explor...
Monitor, Alert and Aut...
Office Development wit...
Office Live Small Busi...
Phoenix
Regular Expressions
Security for Azure
SyncFx - Feedback [Rea...
SQL Server 2014 In-Mem...
TFS Deployment to Azure
Tools for Windows Phon...
Visual Basic 2008 (Pre...
Visual C# Express Edition
Visual C++ Express Edi...
Visual Studio Applicat...
Visual Studio Performa...
Web Development in Vis...
Web Sandbox - General
Windows Events
Working with Data in W...
OneDrive Development (...
Kinect for Windows v2 SDK
Windows IoT

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile