In the APEX world, just remember You do not need to reinvent the wheel!
First, select the button you want this behavior, then set the property Target to URL.
The second parameter can be used to set the value of REQUEST, when the page is submitted. You can use this value selectively run some Process point, setting the property Condition to “when request = value”.
For more complex needs, you can set Apex Items values, before to proceed with page submit. In this case, the second parameter should be an Object, with all items and values necessary for your page flow and correct process.