Organizing WF4 workflow xaml - workflow-foundation-4

I have a rather large workflow defined in xaml, consisting of nested flow-charts and sequences.
It's a pain to click through the entire hierarchy to modify an activity which is deeply embedded in the workflow. After a project rebuild, the workflow designer resets to the top view, so I have to do this alot.
Is there a way to create separate xaml files containing parts of the main workflow and including them in the main file ? This way, I would be able to edit by simply opening the sub-flows from the solution explorer.
Would invoking a subflow xaml from a CodeActivity seem like a good idea ?
Any other hints to speed up workflow editing ?
Thanks in advance.
Janiek

Assuming you are talking about Visual Studio, Custom XAML Activities are a possible solution.
How to - you can create a separate file wrapping one of the flowcharts called e.g. FlowActivity1. When you build the project, you should see FlowActivity1 appears in the Visual Studio toolbox. You can then go to your main workflow, and replace the flowchart with FlowActivity1. You will also need to create Arguments on the FlowActivity1 activity in order to pass in variable values from the main workflow.

Related

How do I manage BizTalk files outside of the IDE? Need some architecture advise

Well in general I am new to BizTalk and maintaining a very old setup, BT 2013 R2
Overall I am well versed in .XSLT and feel more comfortable managing xml directly than I do in the BT IDE ( well the vstudio IDE)
So here are a couple generic architecture questions:
What are the steps to manage the maps manually through notepad? I see a lot of code in the .BTM.CS file, but those don't seem to get picked up. I seem to have to change the .BTM file first, then it generates the .BTM.CS
My Map is Huge, I'm working with X12 and there are thousands of fields, what can I do to make this easier? I have to scroll through 10 layers deep just to make anything visible, then expand the map. BT IDE seems to have a big issue dealing with such big files
Also any books anyone can recommend on the subject would be appreciated
I will say this first, I totally understand where you're coming from, but...
You don't, sorry. The BizTalk Visual Studio Project System is an integral part of BizTalk development and you really, really, really should not even try using a text editor. .odx, .btm, .btp are all meta files managed by their respective designers. The .cs files are generated at Build-time so there is not opportunity to modify them at all.
One way to improve Mapper performance is to areas of function into separate Tabs. The rendering of the design surface is the problem so the less to render at once, the better. Even separating direct links and Functoids helps.
Sandro's book is the current standard: BizTalk Mapping Patterns & Best Practices
Johns-305's answer is good - I'd just add that with XSLT in maps you do have the option of setting "Custom XSLT" for the map in the properties window. That can then be pointed to an external (source controlled) XSLT file which you could then edit using any XML/XSLT editor (Visual Studio or not). Just be aware that this option means you won't be able to us any of the visual mapper functionality, and the .btm file will basically just be a pointer to the compiler to use your custom XSLT rather than the XSLT that would be generated by BizTalk. You should not try to manage BizTalk's generated XSLT in this manner - only for cases where you're certain you want to use custom XSLT rather than the visual designer. To do that, open the map in Visual Studio (1), click the grid area (2), and then set the Custom XSLT Path (3):
(It's possible to do that by directly editing the .btm file, but not recommended - I did write a blog a little while back documenting the .btm format for what it's worth though: https://blog.tallan.com/2015/03/26/biztalk-mapper-file-format-btm-documented/.)
For orchestrations, you're out of luck.

Complex UI with MVC

I'm trying to recreate a text editor I've made but using the MVC design pattern; I'm not totally sure about certain parts of it.
For example, I have a tree view displaying my project directory, and a text editor showing the contents of a file, along with this i have output from compilation of files being displayed as well as a tabbed interface.
Would this be split into a few different models or under one big model? If it's under 1 big model how would I go about using the Qt model classes for such a thing?
Open up Qt Designer and drag and drop all the stuff you need. It should get you pretty far.
I think the only model/view you should worry about is the QFileSystemModel and pairing it up with a QTreeView. Everything else Qt has some nice examples showing how to do it.
If you are showing multiple files at once in separate tabs, then you might want to look into the Tabbed Browser Example to see how its done.
http://doc.qt.io/qt-5/examples-mainwindow.html
http://doc.qt.io/qt-5/qtwidgets-richtext-syntaxhighlighter-example.html
http://doc.qt.io/qt-5/qtwidgets-widgets-codeeditor-example.html
http://doc.qt.io/qt-5/qtwebkitexamples-webkitwidgets-browser-example.html
I like QDockWidgets and using QActions and putting them on the QToolbar in a QMainWindow.
http://doc.qt.io/qt-5/model-view-programming.html
http://doc.qt.io/qt-5/qfilesystemmodel.html#details
http://doc.qt.io/qt-5/qmdiarea.html#details
http://doc.qt.io/qt-5/qtextedit.html
For the compilation part you will just need to create a QProcess and connect its output to a QTextEdit.
Hope that helps.

Models are missing in strongly typed view drop-down

First of all, I apologize if this question is unclear, I am going to try and be as clear as possible.
My solution has 2 projects: Models and View/Controller. The View/Controller project knows what is in the Models project but not vice-versa.
I have created some Text Templates to automatically create CRUD Pages that work when I use the Add View dialog box to add new Views. This obviously happens in the View/Controller project. I've been using this without issues for a long time.
I am able to run the project without syntax errors or runtime errors, but when I use the Add View Dialog Box to try and create a new page, I choose the strongly typed option and I do not see anything from the Models project.
Things I have tried:
Reattaching the DLL for the Models as a reference to the View/Controller project again.
Build and Rebuild as well as Cleans
Manually typing everything in the dialog box (fails).
I do not want to create this page manually, as it will make errors/bugs very likely whereas the Template will reduce the amount of bugs I am likely to encounter.
Don't know how it did it, but I cleaned the project again (after failed attempts) and it finally works.
Before Adding View just Build the solution and then add view it will work. if it will not work then you can again concern with me i will give you another solution

Share Site Map Across Multiple Projects or Sitemap with Sql Data Source

I had this big problem.
Now, I've refactored my code to have a data layer, business layer and the main project as the view layer. Next I'd like to split this big project smaller projects based on discrete functionality.
As I understand it, one way to handle a shared masterpage is to copy it into each project, that's not the worst thing, it hasn't changed in over a year and if it does it's easy enough to propagate the changes out to the other projects.
I was also reading that I could create an assembly from my master page and share it that way.
My masterpage.aspx has a reference to a asp.net sitemap, Unlike the masterpage I'd like to maintain only one site map if possible. Does anyone have a good suggestion?
Thanks
Jim
EDIT: I did exactly this, thanks for the push in the right direction.
Give this a try:
In Visual Studio choose the project that you want to keep your sitemap file in then in the other projects add an exisiting item and select your sitemap file. On the 'Add' button of the 'Add Exising Item' dialog click the down arrow and select 'Add As Link'. This should work with a master page as well. Then you will only have one file to maintain.
You could implement a CustomSiteMapProvider and store the sitemap in the database, this way the common sitemap items will be an SQL Script?

Best way to encapsulate component that includes logic and webforms

I have written a data browsing library that is being used in several projects. The library or component includes some classes as well as some ASPX pages.
Until now, we copy all the files into each project to reuse it, with the obvious drawbacks and updating nightmares. I want to encapsulate all the library into a component that the projects can use.
What's the best way to do it? I know I can create a DLL, but I think it's only for the classes, don't know how to go with the ASPXs pages.
We are using Visual Studio 2008 and Framework 2.0
Thanks in advance
This is a perfect case for custom controls.
Change the pages into user controls, and embed the new user controls back into pages that have nothing in them but the reference to the user control.
Once that works, you can change the user controls into server controls, little by little. They will be composite controls, as the user control already is.
There's a trick you can use at this stage: I'm not recalling the details this late at night, but someone else will fill those in: when ASP.NET compiles a page, it first "compiles" the markup into source code, then compiles the source code. You can get ASP.NET to not delete the temporary source files. That allows you to copy into your project code that creates precisely the same HTML as the user control did.
The difference will be - it's now your code and you can refactor it as much as you like, or even include it in a custom control library.

Resources