Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

create multiple tasks in a State Machine workflow?

1,105 views
Skip to first unread message

Jeff Richardson

unread,
Mar 10, 2008, 1:15:02 PM3/10/08
to
I have a non-trivial SharePoint State Machine workflow that in one of its
states needs to create multiple SharePoint tasks. Once all the tasks have
been completed the workflow can move on to another state.

I have tried several different ways to implement this but I have found none
that work. The problem stems from that while you can use a Replicator in the
State Initialization there does not seem to be a way to setup a corresponding
number of onTaskChanged events.

Replicator examples I have seen all use a sequential workflow model. The
same technique does not seem to work for State Machine workflows because it
will not allow activities at implement IEventActivity to be added to the
states stateInitializationActivity. This limitation means that the
createTaskActivity and the onTaskChangedActivity cannot be in the Replicator.

How do I create multiple tasks in a State Machine workflow state?

Has anyone tried using InvokeWorkflow to synchronously call a sequential
workflow to do the work?

Thanks in advance.

--
Jeff Richardson

Steven Cheng

unread,
Mar 11, 2008, 2:04:28 AM3/11/08
to
Hi Peter,

Regarding on the multiple task in workflow issue, I've found some similar
discussion and issues on this. So far what I found is somewhat like you've
described, such parellel tasks are quite hard to do in state machine
workflow. In some former cases, some other engineers have suggested that we
use sequential workflow instead (which may use replicator or multi tasks
more conveniently).

Or someone ever suggested that you launch another workflow from the current
workflow that would create the task and handle the task completion i.e. You
would create a sequential workflow which creates a task and when that task
is set to complete you would create a replicator activity that would call
other instances of the same workflow which will continue until you want the
replicator code to cease calling other instances.

Here is a web entry I've found which also mentioned some suggestion the
replicator related issues:

#Workflow Tasks, the Replicator activity and State Machines
http://www.pseale.com/blog/SharePointWorkflowNuttinessVolume1.aspx

you may also have a look to see whether it helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: msd...@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response

from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take

approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.

The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump

analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?SmVmZiBSaWNoYXJkc29u?= <bobca...@community.nospam>
Subject: create multiple tasks in a State Machine workflow?
Date: Mon, 10 Mar 2008 10:15:02 -0700

Jeff Richardson

unread,
Mar 11, 2008, 1:47:08 PM3/11/08
to
Steven,

Thanks for the response. Unfortunately it is not the response I wanted to
hear. This is a serious design flaw (I know the link you provided states it
is not a design flaw) that Microsoft needs to fix. Microsoft claims that
State Machines are the best way to design workflows that involve people. But
there are few human workflows that don’t involve running tasks in parallel.
I have found no evidence that Microsoft has ever documented that state
machine workflows are designed to not allow multiple tasks to be run in
parallel.

The problem comes from the design of the StateActivity. The StateActivity
has three phases of its lifespan, 1st it allows you to run a sequential
workflow to initialize the state, 2nd it waits for any events that have been
configured, and finally it runs another sequential workflow to clean up the
state. Because the StateActivity has been hard-wired to only accept events
for the ones configured in the second phase it is not possible to use the
ReplicatorActivity in the initialization phase.

To solve this problem, Microsoft should create an additional state activity
that has a simpler lifespan. In the simpler state, the state would only have
one execution phase. In that single phase, a single sequential state machine
could execute without the restrictions on when events can be accepted. With
this simpler state activity it would then be possible to put the replicator
in the state just like you would do in a sequential workflow.

Can you provide a detailed example of how to call a sequential workflow from
the initialization phase of the StateActivity that is able to use the task
and history lists of the parent state machine workflow as well as how to pass
in data to the child workflow so that it can create the tasks?

--
Jeff Richardson

Steven Cheng

unread,
Mar 14, 2008, 5:47:20 AM3/14/08
to
Hi Coconet,

Have you got any progress on this issue or do you need any further help?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Thread-Topic: create multiple tasks in a State Machine workflow?
thread-index: AciDn+2bMtYJmYgSR+eW1pFXx7iCOQ==
X-WBNR-Posting-Host: 24.180.6.50
From: =?Utf-8?B?SmVmZiBSaWNoYXJkc29u?= <bobca...@community.nospam>
References: <6E62BB3A-A103-4B2C...@microsoft.com>
<VzZ7M3zg...@TK2MSFTNGHUB02.phx.gbl>
Subject: RE: create multiple tasks in a State Machine workflow?
Date: Tue, 11 Mar 2008 10:47:08 -0700

Steven Cheng

unread,
Mar 14, 2008, 6:39:32 AM3/14/08
to
Hi Jeff,

Please ignore another wrong message sent due to tool issue. As for those
potential workarounds I mentioned, I just get them from another previous
issue and so far I haven't any existing code or demo on hand. According to
that case, the problem would be quite hard to workaround due to the current
limitation model in state machine workflow. I can understand your concern
and difficulty here, I'll do some further research and may leverage some
further resource to assist you on this issue. Would you send me a mail
through the following address(so that I can ask you for some further things
offline):

"stcheng" + "@" + "microsoft.com"

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?SmVmZiBSaWNoYXJkc29u?= <bobca...@community.nospam>


References: <6E62BB3A-A103-4B2C...@microsoft.com>
<VzZ7M3zg...@TK2MSFTNGHUB02.phx.gbl>
Subject: RE: create multiple tasks in a State Machine workflow?
Date: Tue, 11 Mar 2008 10:47:08 -0700

Jeff Richardson

unread,
Apr 4, 2008, 12:37:02 PM4/4/08
to
Hi Steven,
I sent you an email on Wednesday 4/2/08. Did you receive it?
--
Jeff Richardson


""Steven Cheng"" wrote:

> there are few human workflows that don’t involve running tasks in

Steven Cheng [MSFT]

unread,
Apr 7, 2008, 7:48:17 AM4/7/08
to
Hi Jeff,

I've got the email, just missed it previously and have replied you. Please
check it and let me know.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead

--------------------
From: =?Utf-8?B?SmVmZiBSaWNoYXJkc29u?= <bobca...@community.nospam>
References: <6E62BB3A-A103-4B2C...@microsoft.com>
<VzZ7M3zg...@TK2MSFTNGHUB02.phx.gbl>

<1F8BBEFB-5C80-419A...@microsoft.com>
<95lc5#bhIHA...@TK2MSFTNGHUB02.phx.gbl>


Subject: RE: create multiple tasks in a State Machine workflow?

Date: Fri, 4 Apr 2008 09:37:02 -0700

Igor Lesjak

unread,
Apr 12, 2008, 2:01:47 PM4/12/08
to

Hi Jeff and Steven,

Would you be so kind and publish the solution for the "dynamic
creation of multiple tasks in a State Machine workflow" issue.

Sincerely,
Igor

On Apr 7, 1:48 pm, stch...@online.microsoft.com (Steven Cheng [MSFT])
wrote:


> Hi Jeff,
>
> I've got the email, just missed it previously and have replied you. Please
> check it and let me know.
>
> Sincerely,
>
> Steven Cheng
> Microsoft MSDN Online Support Lead
> --------------------

> From: =?Utf-8?B?SmVmZiBSaWNoYXJkc29u?= <bobcatri...@community.nospam>
> References:  <6E62BB3A-A103-4B2C...@microsoft.com>
> <VzZ7M3zgIHA.4...@TK2MSFTNGHUB02.phx.gbl>
> <1F8BBEFB-5C80-419A-9203-6DA4F9AD1...@microsoft.com>
> <95lc5#bhIHA.6...@TK2MSFTNGHUB02.phx.gbl>

0 new messages