问题
I understand that Windows Workflow foundation 4.5 supports side by side and dynamic update of Workflow definition. I found few samples on internet, but all describes Code based approach for updating the workflow. I wanted to make a utility which is used by developer to update the workflow without coding. (using only Xaml manipulation should be our ideal case)
My Utility does the following things,
- I take Base Xaml (the workflow definition I wanted to update) File Name and Assembly (V1) from User.
- I prepare it for update by calling
prepareForUpdate
API. and save it as a ForUpdate XAML. - I remove Base Xaml From visual Studio project.
- I load that updated Xaml File in project (instead of base xaml) ,and modify the workflow.
- After modification and rebuilding, I again open my update utility and take input from User the modified Xaml (v2) and Create update map.
- After that I tried to update the running instance (using update map), At that time my utility show that they are updated successfully.
- Although they are updated but at run time make undesirable effects (I got exception like {
ICompiledExpressionRoot for compiled location 'a'
}, where{'a'}
is my variable) , related to Expression parsing, Root , etc.
Is anyone trying to achieve same thing or has some idea. my errors are consistent in both Visual Basic and Visual C# based XAML.
回答1:
While we have not run into your specific scenario we have attempted to use Dynamic Update services to come to a solution much like you describe.
Despite having mostly declarative workflows designed entirely in the Visual Studio visual editor we abandoned this tool. In most cases this it was unable to generate an update map, sometimes even throwing parsing exceptions.
Using it really did not feel like it was a fully completed component and the lack of documentation around it, even after so much time has passed after its release, makes me very wary of considering it for anything.
来源:https://stackoverflow.com/questions/22168650/windows-workflow-4-5-dynamic-update-using-xaml-designer