COM/Webservice check if item has a running workflow RRS feed

  • Question

  • Hi,

    I have deployed an external service that will update a specific item in a SharePoint list (or create one if it does not exist yet). When updated, the workflow attached to the list will do something.

    I am using COM in order to update the item.

           ListItemCollection listItems = list.GetItems(query);
                    ListItem listItem;
                    if (listItems.Count == 0)
                        var newItem = new ListItemCreationInformation();
                        listItem = list.AddItem(newItem);
                        listItem = listItems[0];

    The problem is, if the workflow status is "completed" or is in an error state, it will just edit the item because the workflow cannot be restarted. I would like to check if the workflow is still running. If not, it should create a new item.

    What is a solution for this problem?

    • Edited by okdreamy Tuesday, July 9, 2013 11:49 AM
    Tuesday, July 9, 2013 11:46 AM


  • searched on different forum, it seems that it is not possible to know if an item has a running workflow without using Server Object model.
    • Marked as answer by Emir Liu Thursday, July 11, 2013 10:05 AM
    Tuesday, July 9, 2013 7:51 PM