Skip to main content
Nintex Community Menu Bar

Problem with Concurrent Web Service Calls Using a Common Error Variable?

  • August 10, 2020
  • 5 replies
  • 36 views

Forum|alt.badge.img+7

It's Wild Theories Monday here as I track down possible explanations for a Web Service Call that ran but didn't work. 

 

SharePoint 2016 on premises workflow in production that works and hasn't been changed in months. A web service call action in the workflow is copies a document from one library to another. It normally does this just fine. In one instance, the document simply doesn't copy. Looking at the workflow history flowchart, the call web service action is green, the error handling action didn't run (indicating no error) but the document didn't copy. 

 

8644i464043CB891F329C.png

 

The error handling is configured thusly:

 

8645i69D49F9BE3702741.png

 

Several actions further down in the workflow I have another web service call that uses the same blnWebServiceError variable to capture an error. 

 

Is it possible that Nintex is batching these two web service calls, both actions are running nearly simultaneously and setting the same variable before the Nintex workflow processing resumes, and that whichever web service call finished last set the variable? I.e. is it possible that my first web service call ran, experienced an error, set the variable "true" and then the second web service call ran successfully and set the variable "false" and that all happened before the next workflow action occurred here?

8646iAB86E506430ED475.png

 

Should I be using different variables for concurrent web service calls?

5 replies

Forum|alt.badge.img+12
  • Scholar
  • August 11, 2020

@jeff ...Usually if I'm re-using the variable then I simply resets them to blank/empty when I'm done with it.


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • August 12, 2020
Thanks for replying. Not sure that would solve the problem here necessarily. The web service call is going to disregard any previous values and set the variable true or false depending on the outcome. I'm thinking I'm going to try using separate variables though just to be safe.

Forum|alt.badge.img+12
  • Scholar
  • August 12, 2020

@jeff ....instead of creating 2 variables for each web service call, it's better to create 1 variable slt_Blank and create action set for resetting 2 variables....just my 2 cents !!!


Forum|alt.badge.img+7
  • Author
  • Nintex Partner
  • August 14, 2020

Thank you, I appreciate you taking the time to help me out.

I'm not sure I understand exactly what you're saying, to use one variable and then create action sets for resetting 2 variables. 

I am currently using one variable and my question is whether it's possible that these two web service calls, which both use this variable, are running concurrently rather than consecutively and setting the one variable out of order before the subsequent actions which use that variable are able to run. 

In other words, the sequence of actions I've programmed into the workflow is essentially this:

  • Web Service Call 1 runs, setting the common variable either true or false depending on the outcome of the call.
  • Procedure 1 uses the common variable to decide which actions to execute.
  • Web Service Call 2 runs, setting the common variable either true or false depending on the outcome of the call.
  • Procedure 2 uses the common variable to decide which actions to execute.

The question I'm asking is about concurrency in that sequence of events. E.g. is it at all possible that the workflow might actually be executing in this order:

  • Web Service Call 1 runs, setting the common variable either true or false depending on the outcome of the call.
  • Web Service Call 2 runs, setting the common variable either true or false depending on the outcome of the call.
  • Procedure 1 uses the common variable to decide which actions to execute.
  • Procedure 2 uses the common variable to decide which actions to execute.

If this is possible, then it's possible that Procedure 1 is reacting to the outcome of Web Service Call 2

It doesn't make sense to me to reset the common variable between web service calls because (unless I'm missing something...always a possibility) a web service call will definitively set the value of value of the variable true or false when it runs. It completely doesn't matter what the value of the variable was before the web service call set it. If I set the variable to true and the web service call fails, it will still be set to true by the web service call. If I set the variable to false and the web service call fails, it will set the variable to true. Makes no difference how I set the variable before running the web service call, the web service call will always set it.

So if I reset the variable before each web service call...

  • Reset the common variable to false
  • Web Service Call 1 runs, setting the common variable either true or false depending on the outcome of the call.
  • Procedure 1 uses the common variable to decide which actions to execute.
  • Reset the common variable to false
  • Web Service Call 2 runs, setting the common variable either true or false depending on the outcome of the call.
  • Procedure 2 uses the common variable to decide which actions to execute.

... and then if the two actions do run concurrently, I still have the same problem

  • Reset the common variable to false
  • Web Service Call 1 runs, setting the common variable either true or false depending on the outcome of the call.
  • Reset the common variable to false
  • Web Service Call 2 runs, setting the common variable either true or false depending on the outcome of the call.
  • Procedure 1 uses the common variable to decide which actions to execute.
  • Procedure 2 uses the common variable to decide which actions to execute.

I think if I use two variables instead of one common variable, then it wouldn't matter if the web service calls run concurrently:

  • Web Service Call 1 runs, setting the Variable 1 either true or false depending on the outcome of the call.
  • Web Service Call 2 runs, setting the Variable 2 either true or false depending on the outcome of the call.
  • Procedure 1 uses Variable 1 to decide which actions to execute.
  • Procedure 2 uses Variable 2 to decide which actions to execute.

I may be thinking about this all wrong of course, but it would be interesting to know if that concurrency problem might be possible. Thanks again for trying to help me out. 


Forum|alt.badge.img+12
  • Scholar
  • August 19, 2020

@jeff ...If you are actions are sequential then it's going to perform actions in that sequence. If you still have some doubts then try using commit pending changes action between procedure 1 and web service call 2.