locked
Trigger a workflow from the "Create Item" Activity RRS feed

  • Question

  • Hello Folks,

    I am relatively new to MOSS and SPD. I am working on a MOSS2007 site and SPD2007. Is there a way to trigger a workflow from the "Create Item" activity? I am aware that I cannot do it with a single workflow unless the workflow is set to NOT "Automatically start this workflow whenever a new item is created", so I am using two workflows. The first WF is set to run when a new item is created. This WF calculates my variables and stores them in list fields. It is set to pause until one of those variables (Date/Time) is reached and then it sends an email, makes a change to the list item and ends. This change to the list item then triggers the other WF which looks at the stored variables in the list item to populate the new list item to be created. The “Create Item” activity runs properly but when the new item (a recurring or new instance of the first item) is created, it does not trigger the first workflow. It seems to me that this should be pretty straight forward but I cannot figure out why it is failing to trigger.

    Anyone have some insight into this?

    Thanks!

    Patrick

    Thursday, March 3, 2011 9:44 PM

Answers

  • Ok, it is not quite what I set out to do but here is a work-around I have been testing for the last week and it seems to be working fine.

    I created 2 separate lists. The first list contains one instance of each recurring task. These will be the master copies of each task and regularly send new task instances to the second list.

    The second list will contain multiple instances of each task. These are the tasks that must be acted against by the assigned person and will send reoccurring reminders until a given task is marked “Complete”. When a task in list 2 reaches its “Due Date” a new instance is sent from list one. This actually works out a little better as the master instance can be changed if necessary without interrupting instances in list 2 so if a task needs a new person to be assigned to it, this will happen in list one without causing any problems on active tasks.


    Regards, Patrick
    • Marked as answer by PSKelligan Thursday, June 23, 2011 1:17 PM
    Thursday, June 23, 2011 1:17 PM

All replies

  • Hi PSKelligan,

    It is really a strange problem. When I only add a Wait For Field Change in Current Item action in the workflow1 (Start when a new item is created), workflow will start automatically when use Create List Item action in workflow2 (Start when an item is changed).

    From your description, I know that workflow1 is used to calculate variables and send emails when a Data is reached, then send emails and make change to the list item. Could the calculate work in calculate column? And move the other actions to workflow2. As we can see, if you used a pause until one field action, it must be a field had changed, so you can add condition in workflow2 with this field, and so did the send emails action and update action. And delete workflow1.

    Best regards,
    Emir

    • Marked as answer by Leoyi Sun Friday, March 11, 2011 3:20 AM
    • Unmarked as answer by PSKelligan Saturday, March 12, 2011 2:46 PM
    • Marked as answer by Leoyi Sun Thursday, March 17, 2011 3:06 AM
    • Unmarked as answer by PSKelligan Tuesday, May 31, 2011 2:13 PM
    Tuesday, March 8, 2011 8:28 AM
  • Hi Emir,

    Sorry for the slow response but I have been on travel this week. Let me digest your comments (like I said, I am a MOSS/SPD noob) and see if they make a difference with my issue.


    Regards,

    Patrick

    Saturday, March 12, 2011 2:45 PM
  • Hi Emir,

    Thanks for the input and I apologize for the latent responses. I am moving back and forth from project to project. I also tried some workarounds for this with no success. Let me try and re-state the problem as your answer above seems to not approach the precise issue I am having.

    I am trying to create a sort of infinite loop. I have recurring tasks and when a task reaches its due date, I want a workflow to create a new instance of the task in the task list. I have created all of the logic to calculate the next start and due dates for the new instance so that is not a problem. My problem arises when the new task instance is created. I had assumed that the auto-creation of the new task instance would have triggered the workflow associated with the task list but it does not. The only way I can activate the workflow is by manually creating the task item or manually triggering the workflow. I hope I did not misunderstand your earlier response and helped to clarify with this additional post. Do you have any advice for me?

    Also, the reason I cannot delete one of the workflows is explained better than I can explain it in the following link.

    http://blogs.msdn.com/b/sharepointdesigner/archive/2009/07/13/service-pack-2-prevents-an-on-change-workflow-from-starting-itself.aspx

    and...

    http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-secondary-workflow-HA010237656.aspx

    Thanks again for your response.

    Regards,

    Patrick


    • Edited by PSKelligan Tuesday, May 31, 2011 7:32 PM Added another relevant link
    Tuesday, May 31, 2011 2:12 PM
  • Here is a truncated flowchart of what I am trying to do. The part that is failing is the upper right trigger of WF1 from a task update executed by WF2.

     

    http://img.photobucket.com/albums/v240/PSKelligan/Workflowloop.jpg

     


    Regards, Patrick

    • Edited by PSKelligan Tuesday, May 31, 2011 8:27 PM spelling
    • Edited by Mike Walsh FIN Thursday, June 2, 2011 12:27 PM People still use slow lines. Do not force them to open your images. Post the URL only they they have the choice
    Tuesday, May 31, 2011 8:10 PM
  • Ok, I do not have a direct answer for this but I am going to try this work around; I will run test and have a workflow create a new list item in a second list with a workflow associated with it and see if it triggers the workflow. (see diagram if I did a poor job of articulating this).

    Thanks!

     

    http://img.photobucket.com/albums/v240/PSKelligan/CDRLTaskAlertWFFlowChartHighlevel.jpg


    Regards, Patrick


    • Marked as answer by PSKelligan Thursday, June 2, 2011 12:15 PM
    • Edited by Mike Walsh FIN Thursday, June 2, 2011 12:29 PM That edit comment should have started with People still use slow lines. Do not force them to open your images. Post the URL only they they have the choice (I forgot I had Ctrl-C'd the image ...)
    • Unmarked as answer by PSKelligan Friday, June 3, 2011 4:10 PM
    • Edited by PSKelligan Friday, June 3, 2011 4:14 PM Clarifying the content based on an assumed outcome that did not turn out the way I had expected.
    Thursday, June 2, 2011 12:14 PM
  • Casting items from one list to another did not work. When the first iteration hit (i.e. a new and unrecognized list item) it would trigger an associated workflow but on the second iteration, it seems to recognize the item and will not trigger workflows. I thought that the title may be an issue so created a dynamic title with the date and time built in via a dynamic string but that did not help either. The system will just not seem to accept an infinite loop. Could this be a safety mechanism built into MOSS 2007?


    Regards, Patrick
    Friday, June 3, 2011 4:41 PM
  • Ok, it is not quite what I set out to do but here is a work-around I have been testing for the last week and it seems to be working fine.

    I created 2 separate lists. The first list contains one instance of each recurring task. These will be the master copies of each task and regularly send new task instances to the second list.

    The second list will contain multiple instances of each task. These are the tasks that must be acted against by the assigned person and will send reoccurring reminders until a given task is marked “Complete”. When a task in list 2 reaches its “Due Date” a new instance is sent from list one. This actually works out a little better as the master instance can be changed if necessary without interrupting instances in list 2 so if a task needs a new person to be assigned to it, this will happen in list one without causing any problems on active tasks.


    Regards, Patrick
    • Marked as answer by PSKelligan Thursday, June 23, 2011 1:17 PM
    Thursday, June 23, 2011 1:17 PM