How can i overwrite the "complete process" button in ProcActionsFrame?

企业微信截图_20180508145337
I want click the button to save data and enter next process

There is an example in the documentation: Contract Editor Controller - CUBA Platform. BPM subsystem.
The .setBeforeCompleteTaskPredicate(this::commit) line tells that the editor will be commited before you complete the process task.