We have a process flow that creates items in a queue and allow users to fill in additional info. After the additional info is filled the user will mark the item as 'Definitive' via the task ‘Handle action’.
This triggers a process flow to send the item via e-mail. However we already have a process flow that processes mails (send_e_mail). The send_e_mail process flow must be run by Indicium Universal to have all the necessary rights to files and the SMTP server.
So we like to do a web request to Indicium Universal to start the send_e_mail process flow (see screenshot below).
Process flow that creates the queue item and calls the send_e_mail process flow via HTTP.
This all seems to be working.
The send_e_mail process flow looks in the queue for the most recent item and sends the e-mail. Because this doesn't guarantee the item to be sent is the item that is just created by the user, we would like to call the process flow API with the PK value of the created queue item.
I've tried to change the HTTP headers, the URL (https://[website]/indicium_universal/iam/[application_alias]/send_e_mail?pk1=1&pk2=100) and fill the Content but without result.
Are we missing something? Is this even a possibility when calling process flows?
Best answer by Mark JongelingView original
What you can do is start the E-mail process flow by calling its Starting point. If that Starting point is a Task, you can then call that Task with parameter values. Would that suffice?
what do you mean with ‘calling a starting point’? The starting point of the send_e_mail process flow / system flow (no user interaction) is an Application Connector.
And as far as I know tasks are still not supported in system flows (even without a schedule). Everything we want to do on the database (like executing task or procedures) must be done via an Application Connector.
That is correct. The only way to let this work now is by having the send_e_mail Process flow start with a Task. You have to duplicate the Process flow in case you also want a System Flow version of it.
That way you can call the Task with parameters, and Indicium Universal will then start the Process flow as it is the Starting point/action of the send_e_mail Process flow.
It is currently not possible to start a Process flow through an API and supply Process variable values.
The following 7 process action can be triggered with an API call and can start a Process flow if they are the Starting action:
are you referring to this? https://docs.thinkwisesoftware.com/docs/indicium/process_flows.html#13-api-trigger
This means I can create a simple process flow (send_e_mail) with a task as the starting point. From my original process flow the HTTP connector will post to Indicium Universal but then to the task.
The body will be filled with the PK values.
According to the documentation this will trigger the process flow because the task is the starting point of a process flow.
Is the process flow (called by the HTTP connector) still executed as the application pool user? (in this case the authentication I put into the HTTP input parameters)
If so, I believe this may be able to work.
I'm going to try this suggestion soon.
Are you referring to this?
Is the process flow (called by the HTTP connector) still executed as the application pool user?
The HTTP connector has a Username/Password section and that user will be the executor of that Process flow. Actions such as Read file and Write file (IO operations) and also the Application connector are always done by the pool user. So if you use the credentials of the application pool user inside the HTTP connector, the whole Process flow is executed by the application pool user.
I've changed the starting point to a task. When testing a 403 error occurs.. The authentication is correct, I have tried it with multiple users.
Trying to POST via Insomnia.
The process flow:
Why do I get a 403 (Forbidden) response?
It can mean three things:
Could you check if one (or more) of these applies? I suspect it is the second option as most PK columns/parameters are set Hidden. But in this case it is needed to be Editable as we want to supply these parameters a value.
Hope this helps!
all parameters are indeed Hidden. That includes the PK parameters.
I can understand why this can be problem: Because the parameters are hidden Indicium Universal will mark them as unauthorized. So the service layer has no knowledge of the parameters.
I’ll test this by changing the PK to editable and synchronizing to IAM.
when the task is added to a menu the process flow seems to work when executing via the Windows GUI. However, after syncing to IAM and posting to the task via Insomnia a 500 error returns.
The Indicium Universal log shows this entry:
2021-04-08T14:58:54.4877187+02:00 0HM7L0TGG6E3I:00000003 [ERR] TSFMessagesMiddleware: An unhandled exception occurred while processing the request. (fffadd8a)
System.InvalidOperationException: BeginExecuteNonQuery: CommandText property has not been initialized
Yes, that is because Indicium only supports Tasks with Task logic type 'Template' in the Process flow. The opening Tasks should have a template attached.
that's a bummer. Perhaps the documentation could be updated with this information (and maybe more info of the messages above)? So other developers don't make the mistakes/assumptions I make.
I'll give it another go.
it's working! The Insomnia POST to the task starts the process flow and the e-mail is sent.
Thank you for all the help!