Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: WorkFlow Running More Than One Instance At A Time
Topic Summary:
Created On: 02/15/2016 07:02 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 02/15/2016 07:02 AM
User is offline View Users Profile Print this message

Author Icon
StuartNelson
Student (5-19 posts)

Posts: 10
Joined: 08/07/2015

I have a WorkFlow set up with a simple Schedule Condition as a trigger for the process. The process gets instructions from a database and executes them as part of a cycle through various Tasks in the WorkFlow.

My problem is that if I, say, set it to trigger every two minutes and it has several instructions queued up which happen to take more than two minutes to run then it's triggering again in the background while the first instance is still running. So this is causing problems.

Navigating to the WorkFlow, double clicking on it, then going into:

-Default Task Properties (OPTION SECTION)

-Priorities (DOUBLE CLICKED ON)

-Run task if the number of running instances of this task is below the threshold (OPTION SELECTED)

-Running instances threshold (SET TO 1)

-If the condition is not initially met (SUB OPTION SECTION)

-Do not run task (OPTION SELECTED)

My thinking is this should only allow one insance of the WorkFlow to run at the same time. But despite this it still triggers a new instance of the WorkFlow every two minutes.

I understand that the above options are under "Default Task Properties" and I'm guessing it's not solved my problem as they relate to Tasks within my WorkFlow maybe?

But even if this is the case, surely there is an option somewhere to apply a similar restriction to the overall WorkFlow itself?

 

Using BPA Server 9 on Windows XP.



 Category Survey
AutoMate BPA Server 9 version: 9.0.4
Windows version: Windows Server 2003
 02/16/2016 07:26 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Hi Stuart,

As you determined, you can only adjust the threshold of the tasks and not the workflows. Your workflows should be closing/ending rather quickly if there is a previous task already running based on the priority settings. A workflow is a container for your trigger and tasks, just because you see a workflow running does not mean that tasks are executing on the agents.




 Category Survey
AutoMate BPA Server 9 version:
Windows version:


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 02/16/2016 07:54 AM
User is offline View Users Profile Print this message

Author Icon
StuartNelson
Student (5-19 posts)

Posts: 10
Joined: 08/07/2015

Because there are several Tasks in the WorkFlow (there needs to be) I am having problems as it's not stopping the process rerunning multiple times in parallel as the extra instances aren't necessarily on the same Task as the original.

Even if a duplicate process arrives at the same Task within the WorkFlow it's not stopping (as the settings should dictate, from another thread on this forum this seems to be a known bug) and just hanging on the server at best instead of just escaping.

I can get around it by creating and adding a Task at the start of the Workflow that creates a file if not already in existance, and if it does exist this then allows a method of escaping from the WorkFlow without action as it means the process is already running. At the end of the WorkFlow another Task deletes the file, freeing the process up for the next time once the original process (the one and only instance that should be running) completes.

But it seems ridiculous there is not an easier way to do this.



 Category Survey
AutoMate BPA Server 9 version: 9.0.4
Windows version: Windows Server 2003


Edited: 02/16/2016 at 08:00 AM by StuartNelson
 03/02/2016 06:57 AM
User is offline View Users Profile Print this message

Author Icon
Alex Escalante
HelpSystems

Posts: 871
Joined: 02/26/2014

Hello Stuart,

The file creation/check method that you are currently using is a good workaround to employ if you are having difficulty with running workflows at the same time.

You mentioned that the workflows are not stopping, what method are you employing to try and stop the workflow?

 Category Survey


-------------------------

Alex Escalante | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 03/03/2016 03:35 AM
User is offline View Users Profile Print this message

Author Icon
StuartNelson
Student (5-19 posts)

Posts: 10
Joined: 08/07/2015

In the "Default Task Properties" of the WorkFlow I initially used the threshold of 1 as per my previous post and set to not run any further instances of that specific Task if the threshold of 1 was reached (which to me means do not run if already running).

My understanding is this is related to Tasks within the running WorkFlow and not the WorkFlow itself, the equivalent setting for WorkFlow seems to be missing. But even when assuming this is true the options don't seem to be behaving as you would logically expect.

To test I manually triggered several versions of the same WorkFlow (a couple of seconds delay appart), then in the Execution Status window of the Console you could see each WorkFlow progressing through the Task sequence. Because one of the Tasks took quite a bit longer than the others to execute, typically this would be the Task that would then be trying to run multiple times as previous itterations would be still on that Task as newer ones caught up to that point in the WorkFlow. But then instead of stopping with Success or Failure the multiple versions would just hang on the Execution Status list instead of progressing through their respective workflows.

I have removed this option and used the default ("Always Run Task" maybe?) rather than risk letting Tasks hang this way.

Also, to complicate things I have four WorkFlows sharing the same Tasks in this process (with Tasks unique to each WorkFlow setting variables specific to the WorkFlow). I'm not sure what affect the threshold limit has across WorkFlows and whether Tasks within might hang if being used by one of the alternate versions of the WorkFlow (because variables are passed to the common Tasks it's not a problem if they run multiple times within different WorkFlows). So seems safer to leave it on the default and keep my File Lock method in place!



 Category Survey
AutoMate BPA Server 9 version: 9.0.4
Windows version: Windows Server 2003
 03/07/2016 10:50 AM
User is offline View Users Profile Print this message

Author Icon
Justin Aucoin
HelpSystems

Posts: 360
Joined: 02/15/2016

Hi Stuart,

It is possible to have only one instance of a specific task run for a file trigger. In the Default Properties, under Priority, select the Option "Run Task if the number of running instances tasks is below the threshold". Set the instance to 1, and then select "Do not run task". You can set the skipped task instances report as a success or failure, depending on how you want your reporting to appear.
Alernatively you can set the Condition to one of the hold or interrupt options as meets your needs.

I hope this has answered your question. Please feel free to contact us if you have any further questions.


 Category Survey
AutoMate BPA Server 9 version:
Windows version:


-------------------------

Justin Aucoin | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1425 guests browsing this forum, which makes a total of 1425 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog