Solved

How to control 'status code' result from a process action

  • 18 July 2019
  • 4 replies
  • 220 views

Userlevel 2
Badge +2
In one process step I want to check if a certain row meets some criteria. The next process step should depend on the outcome of the criteria check.
As far as I understand this has to be done through the status code result (see attached picture).



My first question is how to control this 'status code' from process action 'execute task'. In other words: How can I link a (output) parameter from a task to the 'status code'.

Second question is wat the type and value of the 'status code' must be. As I understand it has to be an integer and 1 should follow the successful path and -1 the unsuccessful. Is that right?
icon

Best answer by Vincent Doppenberg 18 July 2019, 13:53

View original

4 replies

Userlevel 6
Badge +4
Hi Dennis,

The value of the status code output parameter cannot be controlled. It is a standard output parameter that applies to all process actions and allows you to check the success or failure state of the finished process action.

To achieve the result you are looking for, you can add your own output parameter to the task and set its value in the body of the task procedure. You will then have full control over the data type of this parameter and its possible values. You can then bind this output parameter to a process variable and use a process procedure to choose the next process step based on the value of this variable.

I hope this helps.
Userlevel 2
Badge +2
Hello Vincent,

Thanks for your swift reply.

Could you please explain to me how I have to:

"bind this output parameter to a process variable and use a process procedure to choose the next process step based on the value of this variable."

I understand the part of binding the output parameter to a process variable. But how do I force the flow to a specific direction? Since I only can choose between 'Always', 'Successful' and 'Not successful'.

We're on 2017.1.

See below the flow involved.

Userlevel 6
Badge +4
Hi Dennis,

Please refer to our documentation on application logic with regard to processes. It explains how the logic concept PROCESS can be used to dynamically influence the order of execution in a process flow at runtime. Simply put, you can write a small template (similar to how you would for a default or a layout) in which you indicate the order of the subsequent process steps in the process flow and you can even cause process steps to be skipped entirely.

You can find the documentation here.
Userlevel 2
Badge +2
Thanks for pointing me in the right direction.
Again amazed about all the features of the SF ☺️

Reply