Skip to main content

How to initiate reimbursement process in approval

1. Scenario

There are collaboration requirements between processes within the enterprise, such as business trip process, cooperation between procurement process and reimbursement process, cooperation between product quality inspection and product rework, cooperation between return process and inbound and outbound process.

Before, many users will need to collaborate in a form, which not only increases the construction cost in the early stage, but also causes great troubles to the later maintenance.

Now with the help of service callback sending sub-processes, collaboration between processes can be easily realized, and complex businesses can be easily managed.

2. Collaboration between business trip/procurement/project process and reimbursement process

For users:

  • In the past: a business trip application will be submitted before the business trip. After the business trip is completed, the reimbursement process will be manually entered.
  • Now: you can automatically initiate reimbursement requests through the service callback start process.

For builders:

  • In the past, processes involving reimbursement, such as business trips, procurement, and projects, must repeatedly configure multiple nodes and fields involved in the reimbursement process, which undoubtedly increases many unnecessary costs.
  • Now: you only need to complete the configuration of the expense reimbursement process through the sub-process to easily collaborate with the expense reimbursement process in other related processes.

The following is a brief explanation of the configuration of sending sub-processes through service callback through the collaboration between the business trip process and the reimbursement process.

3. Procedure

3.1 Service registration

Reference documents:Service registration

3.2 Select Open API interface

Because we need to automatically initiate a new process in the approval flow, we can find the new process interface in our Open API, fill it in the URL address, and configure parameters according to the interface.

Reference documents:YIDA Open API (old)

As shown in the following figure:

3.3 formDataJson data format processing

When we initiate a new process, we need to use the data of the form page as formDataJson parameters to the components of the process page. Then, we need to process the data in the form page and process it into JSON format, configure parameters.

3.3.1 create an action event that is triggered when the form page value changes

Because you need to send multiple components, such as member components, subforms, date components, and digital components, to the reimbursement page, we cannot confirm the filling order. Therefore, you need to bind onChange events to each component, ensure that each value can be accurately obtained and processed.

3.3.2 process data and assign data to fromDataJson components

Different components have different data processing formats. For more information, seeSave/update form data format documentsProcess.

The reference code is as follows:

export function onChange_name({ value }) {
console.log('onChange', value);
let cy = this.$('employeeField_kstz236f').getValue();
const name = [];
name.push(cy.name, cy.workNo);
const table = this.$('tableField_kstz236h').getValue();
const newtable = [];
table.map((item)=>{
let data = {
textField_ksu0vp76: item.textField_kstz236j,
numberField_ksu0vp74: item.numberField_kstz4rvs
}
newtable.push(data);
})
console.log('onChange', newtable);
let date = this.$('dateField_kstz236p').getValue();
let money = this.$('numberField_kstz236z').getValue();
const param = {
"employeeField_ksu0vp75": name,
"tableField_kstz236h": newtable,
"dateField_ksu0vp77": Number(date),
"numberField_ksu0vp79": Number(money)
}
this.$('textField_kstz4rvr').setValue(JSON.stringify(param))
}

3.4 configure service callback

3.4.1 configure service callbacks in node submission rules

3.4.2 select the node of the START process

Here, select to issue the sub-process expense reimbursement when the approval of the department leader ends and the result is agreed.

3.4.3 select a third-party service and configure parameters. Here, formDataJson can directly use the# {form component} variable to configure the processed data as parameters, save and publish it after configuration.

4. Effect demonstration

4.1 submit business trip form data after configuration

4.2 After the department head approves, return the process data management page of expense reimbursement. We can see that a process instance has been automatically initiated on the process page. The content of the instance is filled in the business trip application form.

5.Video demo

此处为语雀视频卡片,点击链接查看:服务回调子流程.mov

-------------------- Get the latest information YIDA, welcome to follow US--------------------

This doc is generated using machine translation. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes.
Copyright © 2024钉钉(中国)信息技术有限公司和/或其关联公司浙ICP备18037475号-4