Solved

How to schedule a process flow?


Userlevel 5
Badge +20

I am trying to simply execute a task, without parameters with a process flow every hour.

 

 

 

 

Indicium Universal (2020.2.2) is running, but I don't see any activity.

The version of IAM is 2020.1 and al hotfixes are done.

 

Could someone explain, step by step, what to do? 

 

icon

Best answer by Harm Horstman 22 July 2022, 14:25

View original

28 replies

Userlevel 7
Badge +23

Hey Harm,

In the project I'm working on we use the System Flow to execute an import of data on the background so they do work but...

I'm sad to say that the execution of the process action ‘Execute task’ is not yet supported by the System Flow. The supported process actions are all Connectors, and all folder and file related actions like creating, moving and deleting.

The way to run tasks in the System Flow currently is through the use of the process action ‘DB connector’. This connector is supported and is able to run SQL code, for example to execute a stored procedure, on the given Database.

For more information about the DB connector you can check the Documentation: https://docs.thinkwisesoftware.com/docs/sf/process_flows.html#db-connector

Hope it helps you out.

Kind regards,
Mark Jongeling

 

Userlevel 5
Badge +20

Thanks Mark!

This sounds very disappointing to me. I cannot understand, why is it like that? This is one of the most basic scenarios.

I will try to use the DB connector but I don't like this because I don't want to store DB credentials in the end database especially as I mostly work with Azure databases.

BR,

Harm

 

 

 

 

 

Userlevel 7
Badge +23

I understand the troubles with that. Last I heard is that Product Innovation is working hard to realize all process actions that don’t require user input for the System Flow. It's certainly on their radar.

Good luck Harm!

Kind regards,
Mark Jongeling

Userlevel 4
Badge +3

Just to be sure: this means that when you want to run a task on a regular basis, the only option is to use the connector? Or is there another way to run scheduled tasks? I'm also trying to get this to work.

Userlevel 5
Badge +15

I understand the troubles with that. Last I heard is that Product Innovation is working hard to realize all process actions that don’t require user input for the System Flow. It's certainly on their radar.

Good luck Harm!

Kind regards,
Mark Jongeling

Hi,

Do you know if there are any update on this? I'm also trying something with just simply executing a task (stored procedure) every minute or so.

I do have a very obscure work around for this 🤨. I’ve created a process flow which only executes a http connector (a dummy call to google.com i.e.) and then I’ve attached a control procedure to the http connector (of type processes). I've scheduled this call every minute, and because the proces sql code is called, I can execute sql code scheduled.

Userlevel 7
Badge +23

Hi,

Do you know if there are any update on this? I'm also trying something with just simply executing a task (stored procedure) every minute or so.

I do have a very obscure work around for this 🤨. I’ve created a process flow which only executes a http connector (a dummy call to google.com i.e.) and then I’ve attached a control procedure to the http connector (of type processes). I've scheduled this call every minute, and because the proces sql code is called, I can execute sql code scheduled.

Hi René,

As far as I know they are working on supporting a couple more process actions with the next release of the Thinkwise Suite. I did hear that using the Database connector will be more convenient but we will see when they share the new features and developments.

For my project, we using Database connectors to execute procedures since in the SQL code field of the DB connector we can specify the query. Your solution is also a viable one. We use the Convert JSON to XML process action for creating the connection string needed for the DB connector since we use JSON string text to give parameters and values to the DB connector. The benefit of that is that converting JSON will always work, while theoretically a http connector call to google.com could give an error when google.com doesn’t respond. But I'm very glad google.com virtually always is available :wink:

Userlevel 3
Badge +5

I'm currently trying to implement my first scheduled process and had several Execute Task-actions in mind. In https://docs.thinkwisesoftware.com/docs/sf/process_flows.html#process-schedules I see that Decisions are also supported for scheduling. Since a decision is about the same as an Execute task, I'll put my code inside a Decision.

If anyone knows a reason why this would not work, please let me know why.

Userlevel 7
Badge +23

I'm currently trying to implement my first scheduled process and had several Execute Task-actions in mind. In https://docs.thinkwisesoftware.com/docs/sf/process_flows.html#process-schedules I see that Decisions are also supported for scheduling. Since a decision is about the same as an Execute task, I'll put my code inside a Decision.

If anyone knows a reason why this would not work, please let me know why.

Hi Roy,

Since the 2020.2.8 version of the Indicium (Universal) the Decision node should function inside a System Flow. Edit: So the decision node is a good alternative yes. Also the Application connector can be used for this.

Kind regards,
Mark Jongeling

Userlevel 6
Badge +16

@Roy van Uffelen  please take the following in mind when using a decision node: "A decision node does not perform an actual action. Because of this, no input and output is available.”. If you don't need output then this should work. If you do need output then for the time being the application or database connector is the way to go. 

Userlevel 3
Badge +5

@Erwin Ekkel The program object behind a decision does have input-output parameters for all process variables and for each process step leaving the decision. Changes made to the process variables are available for other process actions that follow this decision.

In this way it is possible for a decision to actually perform an activity. I have not tried to insert/update/delete records through a decision, but retrieving information and updating the the process variables is something I have done, and thus is possible. If this is a bug I'm glad it is there and hope it remains.
I did notice that monitoring the process flow is not as informative as using tasks. That is something that could be improved upon.

Userlevel 7
Badge +23

To verify, the Decision process action does not have Input and Output parameters (Erwin was mentioning the Input and Output tab in the Process flow screen) but yes, the Process procedure does have all the process flow variables available.

That way you can execute any code you would want to in that Process procedure such as reading, using and setting process variables. Yes, insert/update/delete/etc. is all possible.

Monitoring this process action will not result in much information as it doesn’t do anything by itself. It solely executes a process procedure in which a decision can be made :wink: 

Userlevel 4
Badge +2

Hey,
stumbled upon this topic doing research for a system flow that needs to execute a task.
If I am not mistaken we can now use task's in our system flows by using the process action
“execute system task”.
Wanted to put that answer here for future people.

I was searching for process flow start by executing a table task. Read this thread. Is it true that we still can not expect the flow to start if we execute the task via the API? I think this should get more priority, because now we cannot expect the API to behave the same as the GUI’s. That seems as a great liability to me. Is this correct or do I miss something and should it work? I am running Indicium version 2022.1

Userlevel 7
Badge +23

Is it true that we still can not expect the flow to start if we execute the task via the API? I think this should get more priority, because now we cannot expect the API to behave the same as the GUI’s. That seems as a great liability to me. Is this correct or do I miss something and should it work?

Hi Marcjan,

Incorrect, the Universal GUI uses the Indicium API to execute process flow actions.

You can start process flow by using the Execute table task process action, but it cannot start System flows. The difference between the two is that one is initiated by the User (in the GUI or via de API) and the other one by the System - on a scheduled moment or ad-hoc by calling its starting point.

The difference between process flows and system flows become a bit vague due to both types of flows can be started from the API; which is understandable. In our documentation and Software Factory we therefore made it visible which process action are valid for process flows and which are valid for system flows.

Hi Mark, thanks for you reply. Can you help me than with my problem? Maybe this should not be in this thread, but you can probably move it. My problem is this. I have a subscription task subscription_task (i.e. name, email) and in the Process Flow I defined a flow that when this task is executed, a mail should be send (in my case via HTTP connector). When I execute this task in the windows GUI, everything goes well and I receive an email. However, if I execute its API endpoint (http://…………/subscription_task) then the task is executed well, but the email is not sent. So the behaviour of the windows GUI task and the API counterpart is different. Can you help me with this?

Userlevel 7
Badge +23

My problem is this. I have a subscription task subscription_task (i.e. name, email) and in the Process Flow I defined a flow that when this task is executed, a mail should be send (in my case via HTTP connector). When I execute this task in the windows GUI, everything goes well and I receive an email. However, if I execute its API endpoint (http://…………/subscription_task) then the task is executed well, but the email is not sent. So the behaviour of the windows GUI task and the API counterpart is different. 

This is probably due to the calling of the Task itself instead of calling it as a Table task. Some examples can be found here: https://docs.thinkwisesoftware.com/docs/indicium/resource_staging#request-examples-1

F.e.: /country(99)/task_delete_country/stage 

So after the Indicium URL, replace [country] with the table you want to start the Task from, between the (), give in the PK, followed by the task name subscription_task, then stage the Task. Patch any changes to the Task parameters if values need to be changed. Commit once all values are correct.

This is quite a challenging way of programming a process flow to start, so I recommend creating a process flow you can call, like here: https://docs.thinkwisesoftware.com/docs/indicium/process_flows

Thanks, but I do not want to tell a website builder to make use of the staging functionality. 
I just want him to give one endpoint of the corresponding task, which works perfectly except for the process flow. Then, the functionality would be the same for the windows GUI and the API. 

As ThinkWise states in its documentation for resource staging: "For example, when Indicium is called automatically by a third party application or service or by some scheduled process. 
In these cases, when there is no need to indicate to some user whether or not input fields are mandatory, disabled etcetera, a record can still be saved in a single request." That sound logical to me. But this single task request should also trigger any process flows attached to it.

I do not understand why I need to do this in another way. At this moment I have one task for a subscription and I should not create a API flow to be able to do the same. Do you have any other suggestions?

Userlevel 6
Badge +16

Perhaps it would be easier to call a task instead of a table task. A table task needs to be called from within the context of the table. A regular task is easier to call and can also activate a flow. 

 

Hi Erwin, thanks. I already tried that, but I did not get it to work. I will try to solve it this way. If I don’t succeed I will post here again. Thanks for now.

Userlevel 5
Badge +20

@Mark Jongeling any news on this, can you provide an step-by-step example (with images) of a simple process flow that runs a task every hour? Just a simple task without parameters.

From which version will it be possible? I am currently using 2021.2 and cannot upgrade soon.

 

 

Userlevel 6
Badge +16

@Harm Horstman 2021.3 and up have the Execute system task process action. In the 2021.2 you can use either the Decision node/Application connector (or database connector) to execute a Task as a stored procedure within a System flow. 

 

Userlevel 5
Badge +20

@Erwin Ekkel

I have tried both suggestions

Application connector

 

Decision node

 

In both cases nothing happens after sync with IAM. 

Something wrong in de schedule?

 

Userlevel 7
Badge +23

Hi @Harm Horstman, can you confirm the schedule is Active in IAM and that Indicium is running? Maybe there's an error occurring. For that you can check the error log of Indicium.

In addition, the times set in the schedule are UTC times (-02:00 hour at the moment)

Userlevel 5
Badge +20

Hi @Mark Jongeling

At this moment the process flow is not visible in 'Scheduled System Flows’

How can I make a schedule 'Active’ in IAM or in TSF?

Indicium should run in the background, but I am not sure it always is, because end users use the WinGUI and don't make use of indicium.

I have also started indicium.exe to see if that makes any difference, but nothing happens.

With error log you mean all txt files in folder ...\Logs? If so, I see no errors in any of these files

 

 

Userlevel 7
Badge +23

Hi Harm,

By default within the Scheduled system flows screen, you'll see only Active system flows. To also see system flows that do not have any active schedule, disable the “Active” prefilter: 

This prefilter (Active) should be disabled

When this prefilter is Off, all system flows are visible and you can look up the flow you are missing. Select that flow and navigate to the Schedules detail tab of that flow. Here it should show all available schedules for your system flow. To Activate/Use a certain schedule, select it and execute the Activate schedule task: 

By executing this task, the schedule and therefore the system flow will become active

Once the schedule is activated, Indicium will pick-up instances of this system flow on the configured intervals; e.g. every hour.

 

Regarding Indicium's error log, I am talking about the Indicium (Universal) which runs the System flows in the background. This Indicium can be navigated to using a browser such as Google Chrome. The URL should be known to you and looks like: https//[server]/[indicium]. 

When navigated to, you can log-in into Indicium and if you are a Main Administrator in IAM, you should be able to download an Error log from the website:

Error log can be downloaded, you may also have other options or less.

 

Hope this helps!

Reply