## 3 Method  
### Model Based on BPMN-Integrated SC Interaction  
The focus of SC modeling is on the description of the interactions between stakeholders and SCs. BPMN is a widely adopted language to model business processes. However, it is not fully suitable for SC-oriented business process modeling, so we use a limited set of BPMN elements, namely Activity, SwimLane, and Connecting Object of BPMN 2.0, and we customize the meaning of the elements. It connects business people and developers, specifically designed to describe multi-party interactions. The abstract representation of the model based on BPMN as shown in Figure 2.  
Figure 2: Abstract representation of BPMN. * There are three types of activities:
* **UserTask**: This represents the users' actions in external systems, which do not occur on the blockchain, and some of these tasks will invoke the current SC. * **ScriptTask**: This action is performed by the current SC, and it corresponds to a _composite function_. * **ServiceTask**: This action needs to invoke behaviors in other SCs, and it can be regarded as an interaction within the blockchain. * **Swimlane** We design three types of swimlanes, i.e., Participant, Current SC, and External SC. As shown in Figure 2, at the top of the swimlane is the behavior of the Participant. User tasks are modeled in the Participant swimlane; because this type of task is run in an external system, it will not be resolved. Service tasks are modeled in the external SC swimlane, which represents the external SC behavior that the current SC needs to call. The middle part is the current SC swimlane, which is the core of the BPMN model, storing all script tasks of the current SC. * **Connecting Objects*
* **Message Flow:*
* There are two types of message flow. The first type is the interaction between the user task and script task, which describes the interaction between the user and the SC. The second type is the information interaction between the script task and service task, which represents the invocation of external SCs, as shown in the message flow on the left side of Figure 3.
* **Sequence Flow:*
* There are two types of sequence flow. The first type is used to specify the order in which activities are executed. The second type is the interaction between two script tasks in the same swimlane, representing the call relationship. It should be noted that when two script tasks interact, the number on the task flow indicates the execution order of the invocation relationship, and the small number indicates the initiator of the invocation behavior, as shown in the sequence flow on the right side of Figure 3.  
We developed a UI modeling tool based on BPMN-JS ([[https://bpmn.io/toolkit/bpmn-js/](https://bpmn.io/toolkit/bpmn-js/)]([https://bpmn.io/toolkit/bpmn-js/](https://bpmn.io/toolkit/bpmn-js/)), accessed on 1 October 2022) and extended the properties panel to support binding tasks and _composite functions_. Figure 4 is an example showing how our proposed modeling rules can be used to model the flight delay insurance scenario described in Figure 1.  
To achieve the scenario of automatic compensation for flight delays, we use three proposed models. The first model is relatively simple, and we do not present it here. It represents the insurance company's process of maintaining insurance. It includes functions such as adding new insurance, discarding insurance, checking insurance validity, obtaining the percentage of compensation, and verifying the cancellation time. Figure 3: BPMN connecting objects. The second model based on BPMN, shown in Figure 5, depicts the process of the insurance company registering with the CAA. Firstly, the insurance company needs to submit a registration application to the CAA and provide the necessary supporting documents. Once the application is approved, the CAA will initialize the insurance company through an SC. Additionally, the insurance company transfers a deposit to the SC to support future compensation.