Start Subworkflow via Web Service. How can I detect/wait until the subworkflow is finished?


Badge +4

I have a content based Workflow and as part of it I need to call another content type based workflow (PDF creation). The normala start workflow action does not support this type of workflows. To start the Subworkflow via web service works well, but the main workflow need to wait until the subworkflow is finished (the PDF document is available).

How can I realize that?


19 replies

Badge +11

When the initial workflow is complete, you can't call another site workflow which would call your content type based workflow?

Badge +4

Hello ,

the initial workflow is not complete. The subworkflow is part of the initial workflow, but the initial workflow should wait until the subworkflow is finished. With the start workflow action in a library it is easy possible because there is a tick box available. I need the same functionallity for a content type base workflow.

Userlevel 7
Badge +17

In my experience, the PDF creation action is at the mercy of the SharePoint Word automation service. At times the action may complete for the workflow, but the document is created for another hour. Do you know the name of what the file will be before it is created? Is the file being created in another library. You could have the parent workflow loop and pause for an hour until the document is located, or complete the parent workflow and a workflow on the destination library starts up on the new item. If in the same library you can filter the start by extension too.

Badge +4

We use a third party tool to generate the PDF. To work with a pause is a easy way, but not acceptable by our user, when they request a PDF version they need it less or more immediatly.

Again, I would like to create content type based workflows, a workflow in a library which starts on a new item does not fulfill this request.

Userlevel 7
Badge +17

Just so I understand better, what is the need that requires that the workflow be content type based? It is possible to filter workflows based on content type, but are list workflows.

Badge +4

We have lot of lists and project managers are able to create new website to manage their projects. To provide/maintain lists with the workflows is not really managable. As long we are able to provide content type based workflows everything is easy to handle.

Userlevel 7
Badge +17

That's a good reason.

The tool that generates PDFs, I assume it creates the file in the same library it was requested. We haven't discussed what the subworkflow's intentions were. Was it to email the pdf document as an attachment when available?

Badge +4

The libraries contains folders and subfolders with different types of documents (Word, Excel, PDFs aso.) To keep a clear overview about the origin documents and the PDF rendition we would like to collect all generated documents in a subfolder (___CONVERTED PDF) on the top level of the library

Userlevel 7
Badge +17

have you had any further progress on this?

Badge +4

Unfortunally not. I still waiting on an idea or a solution for that issue

Userlevel 7
Badge +17

I know you are looking for the content type based (reusable) workflow so you can manage in one designer all workflows. For the sub workflow, what if its actions were a UDA (user defined action)? Then you can start the workflows with a webservice, and control the workflow logic in one designer for the entire farm. UDA's can be scoped at the Farm, Site Collection, and Site level. When you make changes to one, you can push the updates down to all workflows that use them from one screen.

Badge +4

Hello Andrew,

I do not see why UDA should be able to solve my problem. Within UDA I can not use the default action "Call Workflow" which is able to wait until the workflow is ready because the content type based workflows are not available. The wait until ready is not solved when I use a webservice within a UDA.

Userlevel 7
Badge +11

Hi Robert,

when the child workflow starts on the item, there should be a new column/field on that item.  In your parent workflow, can you put in a Loop with a Pause in it, that periodically checks that field for the status of that workflow?

it's not the prettiest solution, but it should work.

cheers,

Vadim

Badge +4

Hi Vadim,

my Subworkflow is provided by Adlib to create a PDF Document. The workflow creates a new item (the PDF version of a document) and is im principle not able to give something back. Also the loop is not really an option. It is a normal behaviour from a user to have the PDF version as fast a possible. The loop within Nintex is really slow.

regards

Robert

Userlevel 7
Badge +11

If the adlib workflow is running on the current item, then you could potentially use a Wait for Item Update action and get it to look at the field that is named the same as the adlib workflow.  This should pause the current workflow until that field changes.

The Loop action is based on the timer service poll, which is usually 5 mins.

Workflows in SharePoint run in the background of a server, and as a result, a user will very rarely get instant gratification after they do something.  There is usually some delay from when a user completes something to when the next step is in the workflow that notifies them.

cheers,

Vadim

Badge +4

Hi Vadim,

The Adlib Workflow is the sub Workflow which should run as Webservice, therefore this workflow create no change on the current item and the Update action can not work.

regards

Robert

Badge

Hallo Robert,

have you tried Muhimbi Converter? If I remember correctly, they provided this "instant" conversion feeling, that your users seem to require. You can call it via item context menu and/or workflow. Also they can pretty much convert anything to anything, certainly pdf.

best regards

Michael

(not connected to Muhimbi)

Badge +4

Hello Michael,

I am aware about Muhimbi. We decided for several reason to use Adlib as PDF converter, Muhimbi is an alternative product. To have two solutions for similar tasks in production is not really what we want and cost effecient.

Userlevel 5
Badge +9

Hello Robert,

Can you see the Adlib workflow in the workflow history of the current item ?

If so, with the Nintex Web service you can get the workflow history and check if the workflow is running or completed.

As Vadim suggested, you can perform this check in a loop.

Hope this helps

Reply