page linking

On Form Submit redirection to a task or another page based on a user's role

I was trying to implement a simple scenario wherein a user would be redirected to either of the two tasks or forms based on his role, but was unable to do so, due to lack of specific documentation. Can anyone point me in the right direction?

Data Search Form and page linking

I am making a form with three search fields and a Search button. The result of this search shall be displayed on this same page below search criteria in a table.

I have made that page. I have also made custom query which shall get fired when the Search button will be pressed.

FROM Candidate e
WHERE e.ssn = :ssn
OR e.passport = :passport
OR like :name
ORDER BY e.persistenceId ASC

The query needs to search record for any of the data as filled in the form