Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1.7 KB

qs_contract_edit_controller.adoc

File metadata and controls

25 lines (15 loc) · 1.7 KB

Contract Editor Controller

Go to the Controller tab and replace its content with the following code:

link:../../../../source/quickstart/ContractEdit.java[role=include]

Click OK to save the changes.

Let’s examine the controller code in details.

The ProcActionsFrame is the frame that displays process actions available to the user at the moment. On initialization, the frame searches for a related ProcInstance object by two parameters: process code and entity instance. If the ProcInstance object is not found then a new instance is created and the frame displays the start process button. If the related process instance is found then the frame searches for an uncompleted process task for the current user and displays buttons for process task actions. See [proc_actions_frame] for details.

In the contract editor, the process actions frame initialization is performed in the initProcActionsFrame() method. The main part of the method is the invocation of the init(PROCESS_CODE, getItem()). The PROCESS_CODE stores a process code (contractApproval - we saw this value during the model deployment, see [qs_process_model_deployment]). The second argument getItem() is the current contract.

The standard() initialization does the following:

  • initializes standard process actions predicates that will be invoked before the process is started and before process tasks are completed. The predicates commit the entity editor.

  • initializes standard listeners that will show notifications like "Process started" or "Task completed" and refresh the procActionsFrame after the process is started or process task is completed.