AnsweredAssumed Answered

Checking if Workflow Is Running - Custom Status Codes

Question asked by worksofwisdom on May 5, 2016
Latest reply on Sep 8, 2016 by murphybp2

I have 2 library based Nintex 2010 WFs(v2.4.7.0)  associated with the same library- WF1 Calls WF2. The Library requires content
approval.

 

In WF2, I have a number of custom statuses set up - as the WF moves through a state machine, I set the status to the a custom status to correspond to the current State so users can see the progress.  These correspond to the following custom codes when I view them in datasheet mode for the WF Status Column:

 

15 - In Review

16 - Updating

17 - Assigning Authors

18 - Finalizing

19 - Assigning Department Head

20 - Department Head Approval

21 - QCO Approval

22 - Ready

23 - Routing For Approval

 

'Ready' is the code
that signifies the last status set for the workflow - the one that corresponds to 'completed' most closely.

 

There also the OOTB
codes:

Status

Internal Status ID

Description

Not Started

0

The workflow has
  not started.

Failed on Start

1

Indicates that the
  workflow encountered an error when it started.

In Progress

2

Workflow is
  currently in progress.

Error Occurred

3

An error occurred
  during the execution of the workflow.

Canceled (Stopped
  by User)

4

Workflow execution
  was halted by a specified user.

Completed

5

The workflow is
  completed.

Failed on Start
  (retrying)

6

Indicates that the
  workflow is being retried after it failed to start.

Error Occurred
  (retrying)

7

Indicates that the
  workflow is being retried after an initial failure.

View Query
  Overflow

8

This member is
  reserved for internal use and is not intended to be used directly from your
  code.

Reserved for
  Microsoft

15

This member is
  reserved for internal use and is not intended to be used directly from your
  code

 

From
<http://www.vadimtabakman.com/nintex-workflow-workflow-status-codes.aspx>

 

My issue is I start WF2 from WF1 some of the time for some scenarios, and I want to set a condition that only starts WF2 when it is not already running. I noticed that WF 2 can
also have null values in the column - not sure if checking for this will tell me if the workflow is running or not.

 

I have a set condition action that evaluates my Workflow Status Column For WF2-  if it evaluates to Yes, then it will start
WF2 in the yes branch, else it just sends an email. Unfortunately, I am never able to make the condition evaluate to true for my WF2 Status Column
'Controlled Document Approval - Streamlined':

  • Value=strStatusCodeReady = 22  (as string)
  • Value=strStatusCodeCompleted = 5
  • Value=strStatusCodeNotStarted=0
  • Value = 22 (typed in to value field) - should this be an int?
  • Is Empty
  • Value = 4 (not started)

SetCondStatus2.pngSetCondStatus1.png

What pray, am I doing wrong? I don't want to set some library WF state column like a choice column in WF2, and I don’t think I can use library Approval Status reliably. Isn't there a simple solution to checking if a workflow is already running from another workflow?

 

Any help would be much welcome.

 

Thanks!

Outcomes