Use this path for complex business modules that need custom Java service logic, custom business tables, custom forms, or special status repair. The sample is sample_purchase_order.
Create the business contract.
contract_payment.<object_code>_approval.<objectCode>:<recordId>.DRAFT, IN_PROCESS, NEED_MODIFY, APPROVED, REJECTED, CANCELED.Add the table and dictionary migration.
business_key, process_instance_id, approver fields, node remark fields, and reject/cancel reason fields.(tenant_id, order_no/code) and (tenant_id, business_key).sys_dict_type and sys_dict_data.Add backend module files.
TenantEntity.BaseMapper<Entity>.RespInfo, @ApiDecrypt, @ApiEncrypt, and operation logs when the page uses encrypted request flow.Add a FlowDefinition support class.
formAssets(objectCode), fields(recordId), buildTaskFormContext(...), toTaskSaveDTO(...), recordData(...), businessKey(id), and flowModelPayload(...).Add a BusinessCodeFormProvider.
providerKey(), providerName(), formAssets(objectCode), buildContext(...), and saveContext(...).BusinessTaskFormContextVO for task/done/history forms.saveContext, convert BusinessTaskFormSaveDTO to a business DTO and call a business Service method that validates status and node key.buildSummaries(...) with batch query to avoid N+1 lookup in todo/done lists.Start the flow from the business Service.
DRAFT records can start.flowClient.startProcess(modelKey, businessKey, businessType, title, variables, userId, userName, deptId, deptName).businessKey, processInstanceId, approver selections, and set status IN_PROCESS in the same transaction after successful start.Register callbacks.
@FlowBind(modelKey = MODEL_KEY, businessType = BUSINESS_TYPE).@FlowCallback(on = { ON_TASK_CREATED, ON_TASK_COMPLETED, ON_COMPLETED, ON_REJECTED, ON_CANCELED }).Seed App Center and flow binding.
ai_business_suite, ai_business_object, ai_business_app.ai_business_binding with binding_type='FLOW', flowModelKey, titleTemplate, businessBinding, and variableMapping.nodeForms only as compatibility fallback; new node form config belongs in BPMN node attributes.Add frontend only if needed.
DictTag / useDict for status.DRAFT.DRAFT and NEED_MODIFY.DRAFT, REJECTED, CANCELED.DRAFT only.NEED_MODIFY, but repair from IN_PROCESS when the active task node is applicant modify.IN_PROCESS, but repair from NEED_MODIFY when the active task node is an approval node.Use this layout under forge-server/forge-business/forge-business-core/src/main/java/.../<domain>/:
controller/<Business>Controller.java
domain/<Business>.java
dto/<Business>DTO.java
dto/<Business>Query.java
dto/<Business>SubmitDTO.java
dto/<Business>TaskSaveDTO.java
mapper/<Business>Mapper.java
provider/<Business>CodeFormProvider.java
service/<Business>Service.java
service/impl/<Business>ServiceImpl.java
support/<Business>FlowDefinition.java
support/<Business>FlowBpmn.java
vo/<Business>VO.java
vo/<Business>FlowInitVO.java
Mapper XML goes under:
forge-server/forge-business/forge-business-core/src/main/resources/mapper/business/<Business>Mapper.xml