FlowChart workflow - Custom FreeformActivityDesigner sample
Hi,
Here is the long due sample for writing custom activity designers utilizing the freeform activitydesigner. This is still a very crude sample, so we will try to post improved versions from time to time. Thanks to Arjun for the Executors and Validators. The validators show a false positive sometimes because of a bug that we will be fixing soon.
http://www.thispointer.com/workflows/FlowChart.exe
here is a preview of the flowchart workflowtype get
http://www.thispointer.com/workflows/FlowChart.jpg
Hi Ramrajprabju,
I really love this sample. It's the first good example of creating something other than the vanilla sequential or state machine workflow types. I hope to spend more time working with and I'll likely have more questions as I've lots of ideas I'd like to try. For now, I have a short list of issues I've discovered. I know this an early sample, so these may have been resolved already, but I'll record them anway.
- The validator reports false problems sometimes, for example when there is a valid next property for an Action activity. This is also visible in bitmap with shown with the sample.
- The validator reports real errors on the design surface (e.g. invalid next property for Action), but not this error is caught by the build.
- When the Flow activity is used as a top level designer, then it allows only Decision & Action activities as children; validation is reported during build. However, if I make a Flow activity a child of an Action activity, then I can drop any arbitrary activity as a child of the Flow activity, rather than simply a Decision or Action.
Keep up the great work!
Notre
AWESOME!
This is great. Being familiar to the K2 kind of workflow, this feels much better then the sequesial or state machine workflows. However, althought the designer allows parallell actions, I can’t get it to work. Is there something I might have missunderstod?
FirstAction
/\
/ \
/ \
Second Third
\ /
\ /
\/
Fourth
|
Decision (condition checking for execution of "Second" and "Third")
/\
/ \
/ \
true false ="Go to Forth"(Differcult to model in notepad)
|
Fifth
It seems that "Third" is never executed.
Thank you!
I just realized I could put an parallel activity inside an action. This works fine, but I would make it a ”cleaner” model if NextActivityName would be changed to NextActivities…
Hmm.. Never thought of it that way , We only designed each Action to have a next action, but forgot to disable multiple connectors going out. but should be possible to make multiple next actions too if we can store a list of next Actions.
wmmihaa, you're correct - we didn't take into account parallel next activities. As Ramraj said, adding this behavior shouldn't be too difficult. I would caution that if implemented, you should be careful when designing your workflows. If an action has multiple
simultaneous next-activities that are executed, it becomes even harder to follow and maintain the flow of execution.
I made some small modifications:
1. Changed the NextActivityNameProperty (string) to NextActivitiesProperty (List<string>)
2. In the Flow :: OnEvent:
if
(e.Activity is Action)
{ Action lastAction = e.Activity as Action;
foreach (string nextActivityName in lastAction.NextActivities)
{
if (!String.IsNullOrEmpty(nextActivityName))
{
ExecuteInNewContext(context, this.GetActivityByName(nextActivityName));
}
}}
3. I also needed to create a "JoinActivity"
This seams to work great. If you want to source code, just tell me where to upload it.
Thanks guys!!!
By the way, you wouldn't know how to get the connections visible in the monitor (sdk sample)?
The Activity layout is still a mess, but it's the same with sequential workflows, so that is not your problem 
There's a few more things I noticed in the free form designer sample that I'd like to raise as issues. I do have a number of 'how to' questions queued up, but I wanted to raise these issues first, in the hopes that they can be resolved in an updated sample or, if necessary, in the WF before it RTMs. Please see the earlier issues I reported in this post as well.
By the way, is the WF forums the best way to report any issues discovered or is there a bug/issues database where you'd rather I put these types of things?
1. If I create an Action activity, I can place a Flow activity as a child of this Action activity. As a child within this Flow activity, I can link up additional Actions and Decisions (which is great). However, I cannot select the connector between these activities on the Flow design surface. That is, clicking the connecting line of an activity that is embedded as a child of a Flow, which is turn a child of an Action, doesn't select the connection. In contrast, if I create Actions and Decisions directly on the Flow activity when it (the Flow activity) acts as the root designer, I am able to select the connector lines as expected.
2. Selection behaviour within the flowchart designer is confusing. In some cases, when I click to select an activity, I get the actual activity. Other times, when clicking in the general area of an activity I instead get what appears to by a connection point thing (System.Workflow.ComponentModel.Design.ConnectorHitTestInfo). From a usability point of view, this is frustrating. When a connection thing is selected, nothing appears in the VS property sheet except System.Workflow.ComponentModel.Design.ConnectorHitTestInfo. This is a bit tricky to describe how to reproduce. The best way I can describe a repro is this:
- Drop a new Action on the design surface. Do not connect this Action to anything else in the designer, nor drop any other activities as children of this Action. Now try to select the Action by clicking around it's shape. Sometimes you will get the activity and sometimes you will get the connection thing. Once things are connected up or have child activities, this problem is less noticeable.
- I tried reproducing this with the State Machine designer but (thankfully) wasn't able to repro.
This second issue is a big pet peeve for usability. I think it would really frustrate less technical users, which I'd like to make the target of my product (that is based on WF and will use a modified freeform designer).
Thanks again,
Notre
Could YOU make to download some example for "custom designers for the state machine workflow"
Thanks
Hi,
Thanks for this sample. I have a free form workflow designer based on your sample and I'd like to add drop targets in the connector segments. Here is a post in which I gave more detail. I'd appreciate any ideas or pointers.
Thanks in advance,
By changing the designer, is it possible to make the sequential workflow go in a left-right direction?
Thanks
Hi!
I look forward to an imporved version. When will that come?
Keep up the good work!
I am unable to download this sample and it sounds like it will prevent me from reproducing the wheel.
Any samples or guidance on modifying/overriding designer behavior. I would like to expose more information about the activity in the designer, specifically the Condition text.
Thanks
Glenn
You should be able to download the sample now. If still have any problems let me know.