Solved

Start process via Indicium

  • 12 September 2022
  • 7 replies
  • 66 views

Userlevel 3
Badge +5

Hello,

I have created a process flow which does the following steps:

  • Execute task. This task will execute a stored proc to insert a request with the details.
  • Read files + write files: The task will validate if a file is already there, if not, it will create a file and will wait for an anwer file. When that file is placed, it will read the content of that file
  • Execute task process result. The task will execute a stored proc with the contents of the answer file to update the record which has been created in the first task
  • Delete answer files.

This works properly when running it in the Windows GUI.

I have an external program, which needs the same functionality. My idea was to make this process available through Indicium, however when I try to test it, it gives a status 201 Created as return, but nothing has happened (not even the first task). What am I doing wrong and how can I achieve my target?

Process flow

 

Variables

(the given locations exist on the place where Indicium is being run)

The first task which does the insert

Postman

 

icon

Best answer by Vincent Doppenberg 12 September 2022, 19:01

View original

This topic has been closed for comments

7 replies

Userlevel 6
Badge +16

Start task is not a system flow action. Start task or start table task are considered to need user input and are therefor not compatible within a system flow (a process flow triggered via indicium by postman/insomnia). If you want to run this via indicium then change the start task actions to a execute system task action. 

https://docs.thinkwisesoftware.com/docs/sf/process_flows_actions#execute-system-task

Userlevel 3
Badge +5

Thanks for the response.

I will create a copy of the process and will replace the tasks with system tasks. Then I will try it again.

Userlevel 3
Badge +5

I've created a copy. Instead of 'Start task’ I now have Execute ‘System task' (which does the same task).

The parameters of the task are set from the process flow.

Now I get another message in Postman:

 

I don't see the task executing in SQL Extended Events (Is there a better way to monitor the tasks via Indicium.), so I probably missed something.

Do I maybe also need a copy of the task before I can use it as System Task?

Userlevel 6
Badge +16

Do you set any values by a default procedure? The default is not triggered for a system task. Also, did you check the indicium log for any errors? Try a simple update statement within the task procedure that is not using any procedure parameters to see if it ran. 

Userlevel 3
Badge +5

No default is used for that task:

 

But, it was a very good hint to look into the Indicium log:

2022-09-12T15:57:42.1101647+02:00 8002fafc-0001-e100-b63f-84710c7967bb [ERR] Process action 'execute_task_request_reactir' in processflow 'proc_reactir_file_api' returned the following message: Process action 'execute_task_request_reactir' in processflow 'proc_reactir_file_api' was provided with an invalid value '' for its 'ear_tag' parameter. The parameter is mandatory. (708041b0)

 

However, I do give it in the JSON value:

 

 

Userlevel 6
Badge +4

Hello Peter,

Can you try it like this:

  • Use a regular Start task process action for the first task in your process flow. Don't map any input parameters on this process action itself. The input parameters can be supplied through the API call on the task. Calling the task through the API will also cause the process flow to start automaticaly. The API call to start the task is a POST request to /<task_id>, supplying the task parameters in the request body. See our Execute a task example here: https://docs.thinkwisesoftware.com/docs/indicium/api
  • Use an Execute system task process action for the last task in your process flow. Supply the values for the task parameter through the input parameters on the process action.

I hope this helps.

Userlevel 3
Badge +5

I have changed my proc to the following:

 

And removed the input Task parameters for the first task:

 

This now indeed starts the task AND get's the flow started. (A file gets written to disk). Thanks a lot!