Construction and operation method of starting component and starting component

By using JSON structure instead of XML in the Flowable engine's starting component, the automatic loading of process variables is achieved, solving the problem of unspecified variable queries before the process is initiated, and improving the flexibility and scalability of the process.

CN120353992APending Publication Date: 2025-07-22SHANGHAI YILEAD INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510267749.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing Flowable engine technology does not support automatic loading of unspecified variables in the starting component, resulting in the need to query and pass in process variables through a third-party interface before the process is initiated, and the process is complex and inflexible.

Method used

By inserting a JSON structure into the starting component, replacing the traditional XML expression, configuring the http request message and response mapping relationship, the process is automatically parsed and the http request response result is stored in the process variable.

Benefits of technology

It realizes flexibility in process definition, deployment and operation, supports automatic loading of unspecified variables when process initiating, simplifies the process startup process, and improves the scalability and adaptability of the process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353992A_ABST
    Figure CN120353992A_ABST
Patent Text Reader

Abstract

The invention discloses a starting component construction and operation method and a starting component, and relates to the technical field of flow engines, and the starting component construction and operation method comprises the steps that a target starting component is opened on a design process canvas; configuring the http request message of the target starting component; the method specifically comprises the following steps: configuring a resource path, an incoming parameter, a sending mode and a response mapping relation; configuring the flow structure of the target starting component, and deploying the configured flow structure into a flow engine to enable the flow structure to be executed; after the process is initiated, the process automatically analyzes the detailed content of the target starting component, automatically initiates the http request, and automatically stores the response result of the http request in the process variable. According to the method, the JSON structure is inserted into the starting component to replace a traditional XML expression mode, and based on the JSON structure, a process designer can define contents such as node behaviors, interface calling, data mapping and process variables.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of Flowable engines. Specifically, it relates to a method for constructing and running a start component and a start component. Background Art

[0002] Flowable is a lightweight, open-source workflow and business process management platform developed based on Java. It provides functions such as a process engine, a rule engine, and task management, and is mainly used for designing and executing business processes. In the Flowable workflow, the start event is the starting point of the business process, marking the start of the process. During the operation of the start component, the existing Flowable engine technology usually only supports querying all variables or historical variables of the process instance; therefore, before some processes are initiated, the upstream business needs to query all the information required by the process variables first and then, when the process is started, pass it into the process variables. This process requires calling a third-party interface. And currently, there is no component in Flowable that supports the automatic loading of certain unspecified variables. Summary of the Invention

[0003] To solve the above technical problem that the components in the current Flowable engine do not support the automatic loading of unspecified variables, this application discloses a method for constructing and running a start component and a start component. By inserting a JSON structure into the start component to replace the traditional XML expression, based on this JSON structure, process designers can define node behaviors, interface calls, data mapping, and process variables, etc. Specifically, the technical solution of this application is as follows:

[0004] In a first aspect, this application discloses a method for constructing and running a start component, including the following steps:

[0005] Drag a target start component from the component library to the design process canvas; the target start component encapsulates the parameters of the http response into the process variables on the basis of the initial start component;

[0006] Configure the http request message of the target start component; specifically include: configuring the resource path of the http request message, configuring the input parameter of the http request message, configuring the sending method of the http request message, and configuring the response mapping relationship of the http request message;

[0007] Configure the process structure of the target start component, and deploy the configured process structure to the Flowable engine so that it can be executed;

[0008] After the process is initiated, the process automatically parses the details of the target start component, automatically initiates an HTTP request, and automatically stores the response result of the HTTP request in the process variable.

[0009] In some embodiments, the method for constructing and running a start component further includes constructing the target start component, specifically including:

[0010] Design based on the initial start component in XML format, and add several HTTP request messages in JSON format;

[0011] Use the Flowable engine to identify the HTTP request messages and the detailed parameters of the HTTP request messages within the initial start component; the detailed parameters are stored in the database in JSON format;

[0012] Concatenate the detailed parameters into a normal HTTP request, send the HTTP request to the Flowable engine to obtain an HTTP response; then encapsulate the parameters returned by the HTTP response into the process variable in the initial start component to obtain the target start component.

[0013] In some embodiments, configuring the process structure of the target start component and deploying the configured process structure to the Flowable engine so that it can be executed; specifically including:

[0014] Read the unique identifier of the defined process and the identifier of the application to which the process belongs to generate a basic process structure;

[0015] Read the HTTP interfaces required in the process and their invocation methods, and create corresponding service task nodes for each HTTP interface;

[0016] Map the return value of the HTTP interface to the form field through the response mapping relationship;

[0017] Parse the response path in the return value of the HTTP interface at runtime and dynamically assign the response path to the process variable.

[0018] In some embodiments, the method for constructing and running a start component further includes: setting the initialization of global variables in the process by defining the form field and the initial value of the form field.

[0019] In some embodiments, by adjusting the configuration of the response mapping relationship, new form fields are added or existing form fields are changed.

[0020] In some embodiments, the JSON format is adopted to map the field names of the form fields to the response paths of the http interface; the http interface supports dynamically mapping multiple form fields.

[0021] In some embodiments, an http request is initiated through the httpTask component, and the response result of the http request is automatically stored in the process variable.

[0022] In some embodiments, the httpMapper component automatically parses the response mapping relationship and sets the process variable for subsequent nodes to use.

[0023] In some embodiments, the httpMapper component extracts data from the response variable name and assigns it to the process variable.

[0024] In a second aspect, the present application also discloses a start component, which is the target start component in the construction and operation method of a start component described in any of the above embodiments.

[0025] Compared with the prior art, the present application has at least one of the following beneficial effects:

[0026] The present application discloses a construction and operation method of a start component and a start component. In the field of flowable workflows, the process definition is described based on the JSON data structure, aiming to replace the traditional XML expression method, making the definition, deployment, and operation of the process more flexible and facilitating expansion. Through this JSON structure, process designers can define node behaviors, interface calls, data mapping, and process variables, etc. Through the novel start component disclosed in the present application, only when configuring the http request, the interface input parameters, output parameters, and mapping relationships, etc. need to be configured clearly, and the call and filling of process variables will be automatically completed when the process is initiated. Only a small number of parameters need to be provided during the call, and the start component of the present application can automatically query and load, and fill the results of querying some unspecified variables into the process variable. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above characteristics, technical features, advantages and their implementation manners of the present application will be further described below in a clear and understandable manner in combination with the drawings in the preferred embodiments.

[0028] Figure 1 It is a schematic diagram of the running process of the Flowable workflow in the prior art;

[0029] Figure 2 It is a schematic diagram of the running process of the Flowable workflow using the start component disclosed in the present application;

[0030] Figure 3 A flowchart of the steps of constructing a starting component and running a target starting component in the operation of the application;

[0031] Figure 4 This is a flowchart of the steps of constructing a target start component in an embodiment of a method for constructing and running a start component of the present application. DETAILED DESCRIPTION

[0032] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0033] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections.

[0034] In order to simplify the drawings, only the parts related to the invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0035] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific implementation methods of the present application will be described below with reference to the accompanying drawings. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0037] Flowable is a lightweight and open-source workflow and business process management platform developed based on Java. It provides functions such as a process engine, a rule engine, and task management, and is mainly used for designing and executing business processes. In the Flowable workflow, the start component (Start Event) is the starting point of the business process, marking the start of the process. During the operation of the start component, the existing Flowable engine technology usually only supports querying all variables or historical variables of the process instance; therefore, before some processes are initiated, the upstream business needs to query all the information required by the process variables first and then, when the process is started, pass it into the process variables, and this process requires calling a third-party interface. Currently, none of the components in flowable support the automatic loading of certain unspecified variables.

[0038] The running process of the Flowable workflow in the prior art refers to the attached instruction manual Figure 1 As shown, in the scenario of a customer complaint work order, for example, on the work order submission page, there are the complainant, the complaint object, the complaint problem, and the specific information of the vehicle. When submitting the work order, the only known interface in advance is the vehicle identification number (VIN) of the frame number. Many vehicle information, such as the engine number, vehicle series, vehicle model, dealer information, etc., is obtained by calling a third-party interface. The upstream business needs to query this information first and then fill it into the process variables before starting the operation of the process start node.

[0039] This application discloses a method for constructing and operating a start component and a start component. In the field of Flowable workflow, it describes the process definition based on the JSON data structure, aiming to replace the traditional XML expression method, making the definition, deployment, and operation of the process more flexible and facilitating expansion. Through this application, it is expected that when the process is initiated, the caller only needs to provide a small number of parameters, and then the start component of this application can automatically query and load, and fill the query results of certain unspecified variables into the process change variables.

[0040] When using the start component disclosed in this application, the running process of the Flowable workflow refers to the attached instruction manual Figure 2 As shown. In the business scenario of a customer complaint work order, when the third-party interface needs to call the start workflow creation interface, the business party only needs to pass in a vehicle VIN or personal ID information, and when submitting the form process, automatically pass in the detailed vehicle information or personal detailed information into the form.

[0041] Refer to the attached instruction manual Figure 3 As shown, an embodiment of the method for constructing and operating a start component in this application specifically includes the following steps:

[0042] S100. Drag the target start component from the component library onto the design process canvas; the target start component encapsulates the parameters of the http response into process variables based on the initial start component.

[0043] Specifically, create a flow chart in the process designer, drag the start component into the process design canvas, and the start component serves as the starting point of the process. In this application, the target start component is different from the existing start component based on the XML structure. It encapsulates the parameters of the http response into process variables based on the initial start component. Its main function is to enable the callee to automatically query and load through a small number of parameters when calling, and fill the results of the query of some unspecified variables into the process variable.

[0044] S200. Configure the http request message of the target start component; specifically include: configure the resource path of the http request message, configure the input parameter of the http request message, configure the sending method of the http request message, and configure the response mapping relationship of the http request message.

[0045] Specifically, in an implementation manner of this embodiment, the following configurations are sequentially completed for the http request message: 1. Configure the URL of the http request, that is, the resource path of the request; 2. Configure the input parameter of the http request; 3. Configure the sending method of the http request, including: GET, POST, PUT, DELETE, etc., indicating the type of the request; 4. Configure the mapping relationship of the http request, that is, mapperEntity. Use the JSON format, map the field name (such as carName) to the HTTP response path (such as $.data.carName). For example, $.data.name maps to name in the process variable; $.data.vin maps to the vin vehicle identification number in the process variable.

[0046] More preferably, use the httpMapper component to configure the mapperEntity (mapping relationship): httpMapper automatically parses the mapperEntity and sets process variables, such as formField_carName and formField_carColor, for subsequent nodes (such as userTask) to use. Optionally, it supports dynamically mapping multiple fields and can be extended as needed.

[0047] S300. Configure the process structure of the target start component, and deploy the configured process structure to the flowable engine so that it can be executed.

[0048] Specifically, configure the flow logic from the start event to the next node to define the process, and deploy the designed process definition to the Flowable engine.

[0049] S400, after initiating the process, the process automatically parses the details of the target start component, automatically initiates an http request, and automatically stores the response result of the http request in the process variable.

[0050] Specifically, trigger the process instance through the API or tools provided by Flowable (such as REST API or Flowable Task application). After the process is triggered, the process automatically parses the details of the start component of the invention, automatically initiates an http request, and automatically encapsulates the response of the http request into the process variable.

[0051] Preferably, initiate an http request through the httpTask component, and automatically store the response result of the http request in the process variable.

[0052] Based on the above embodiments, another embodiment of the method for constructing and running a start component disclosed in the present application further includes: constructing the target start component, referring to the attached drawings of the specification. Figure 4 As shown, it specifically includes the following steps:

[0053] S010, design based on the initial start component in XML format, and add several http request messages in JSON format.

[0054] Specifically, first design the structure of the http request message, including selecting a suitable http method according to requirements, determining the target address of the request, including the protocol, domain name, and path. According to the requirements of the target API, set the necessary header information, and design the format and content of the request body. For example: for JSON format, organize a reasonable JSON object. For form data, prepare key-value pairs.

[0055] Integrate the http request in the component, and design the location to initiate the http request. Parse the response data (such as JSON or XML). Update the component state or execute subsequent logic according to the response content.

[0056] In another implementation manner of this embodiment, it further includes testing and optimizing the http request message, and testing the behavior of the HTTP request in different scenarios.

[0057] S020, use the flowable engine to identify the http request message in the initial start component and the detailed parameters of the http request message; store the detailed parameters in the database in JSON format.

[0058] Specifically, the detailed parameters include the Request Line, Request Headers, and Request Body. Among them, the Request Line is the first line of the HTTP request message, containing the request method, request URI, and HTTP version. The Request Headers contain a series of key-value pairs used to pass additional request information to the server. Common request header fields include: Host, which specifies the target server address of the request; User-Agent, which identifies client information such as the browser type; Accept, which specifies the response content types that the client can accept; Content-Type, which specifies the media type of the request body, etc. The Request Body is optional and is used to carry data sent by the client to the server. Depending on the Content-Type, the format of the request body is also different.

[0059] The database of the Flowable engine is a database used to store and manage data such as business processes, workflows, tasks, and historical records. Flowable supports multiple database types, including relational databases such as MySQL, PostgreSQL, and Oracle. After storing the request parameters, the system can adjust the business logic through database queries and analysis without modifying the code. For example, specific requests that meet certain conditions can be quickly filtered out through SQL queries.

[0060] S030, splice the detailed parameters into a normal http request, send the http request to the flowable engine to obtain an http response; then encapsulate the parameters returned by the http response into the process variables in the initial start component to obtain the target start component.

[0061] Specifically, the existing initial start component has no http request message, and the flowable engine directly recognizes the start component. This is not convenient for technicians to freely configure content such as nodes and initial parameters. This makes it difficult for the process to dynamically adapt to different business requirements at startup, especially when the business requirements require dynamically passing unspecified parameters at startup. In practical applications, it may be necessary to interact with other systems at startup (such as obtaining external data, calling APIs, etc.).

[0062] This application encapsulates the parameters returned by the http response into the process variables in the initial start component, which overcomes the technical problem that the start component of Flowable in the prior art does not support directly expanding these functions and needs to be implemented through additional third-party interfaces.

[0063] Based on the above embodiments, another embodiment of the method for constructing and running a start component is disclosed in the present application. The step S300 specifically includes the following sub-steps:

[0064] S310, Read the unique identifier of the defined process and the identifier of the application to which the process belongs, and generate a basic process structure.

[0065] Specifically, parse the process metadata: Read the processId and appId, and generate a basic process structure. Among them, the processId is the unique identifier of the defined process, which is used to distinguish different business processes. In Flowable, each process definition has a unique processId, which is used to start a process instance, query the process status, or manage the process. The JSON processId corresponds to <process id=""> in Flowable XML.

[0066] The appId is the identifier of the application to which the process belongs. It is the unique identifier of the application program, which is usually used to associate the process with a specific application program or system. In a multi-application system, the appId is used to distinguish process instances created by different applications. It is convenient to classify and manage the processes.

[0067] S320, Read the http interfaces required in the process and their call methods, and create corresponding service task nodes for each of the http interfaces.

[0068] Specifically, generate nodes: Read the interfaceList, and create corresponding service task nodes for each interface. Among them, the interfaceList is the http interfaces required in the process and their call methods, which correspond to the http call configuration in the service task node. In the process, the interfaceList is a collection of interface calls, which is used to define the external system interfaces that need to be called in the process. The definition includes information such as the URL, request method, and parameters of the interface.

[0069] S330, Map the return value of the http interface to the form field through the response mapping relationship.

[0070] Specifically, establish a mapping relationship through the mapperEntity, and bind the return value to the form field. Among them, the mapperEntity represents the mapping relationship, which is a data mapping entity and is used to map the data in the process to the data structure of the external system. It is used to define the path parsing and data binding of the interface return value. In the process, the mapperEntity is used to map the http interface return value to the form field or process variable.

[0071] In one implementation of this embodiment, by defining the form fields and their initial values, the initialization of global variables in the process is set.

[0072] Specifically, formValueList is used to describe the form fields and their initial values, which is equivalent to the initialization of global variables in the process. formValueList is a collection of form data, usually used to store the form information filled in by users during the process. In the process, user tasks usually require filling in forms, and formValueList is used to store this form data. The data can be stored in the form of key-value pairs.

[0073] In another implementation of this embodiment, by adjusting the configuration of the response mapping relationship, new form fields are added or existing ones are changed. Specifically, to add a new field, only the configuration of mapperEntity (mapping relationship) needs to be adjusted, which is convenient for maintenance and flexible expansion. Just configure the mapping relationship between the interface input parameters and output parameters clearly in the mapping relationship, and the call and filling of process variables will be automatically completed when the process is initiated.

[0074] S340, at runtime, parse the response path in the return value of the http interface and dynamically assign the response path to the process variable.

[0075] Specifically, runtime mapping: At runtime, parse the JSON path (such as

[0076] $.carName) in the interface return value and dynamically assign it to the process variable.

[0077] In one implementation of this embodiment, in JSON format, map the field names of the form fields to the response paths of the http interface; the http interface supports dynamically mapping multiple form fields.

[0078] Specifically, the configuration of mapperEntity (mapping relationship) of httpMapper: In JSON format, map the field name (such as carName) to the HTTP response path (such as $.data.carName). It supports dynamically mapping multiple fields and can be expanded as needed.

[0079] Another embodiment of the method for constructing and running a start component provided by this application, based on any one of the above embodiments of the method, further includes:

[0080] Automatically parse the response mapping relationship through the httpMapper component and set the process variables for subsequent nodes to use.

[0081] Specifically, httpMapper automatically parses the mapperEntity (mapping relationship) and sets process variables, such as formField_carName and formField_carColor, for subsequent nodes (such as userTask) to use.

[0082] In an implementation manner of this embodiment, data is extracted from the response variable name through the httpMapper component and mapped into the process variable. Specifically, the new httpMapper component is used to extract data from the responseVariableName (response variable name) and map it into the process variable. More preferably, the httpTask component and the httpMapper component are parallel.

[0083] Based on the same concept, the present application also discloses a start component. The start component is the target start component in the construction and operation method of a start component described in any of the above embodiments.

[0084] Specifically, in an embodiment of a start component of the present application, the target start component is obtained based on the following construction method:

[0085] Design is carried out on the basis of the initial start component in XML format, and several http request messages in JSON format are added.

[0086] The flowable engine is used to identify the http request messages in the initial start component and the detailed parameters of the http request messages; the detailed parameters are stored in the database in JSON format.

[0087] The detailed parameters are concatenated into a normal http request, the http request is sent to the flowable engine to obtain an http response; then the parameters returned by the http response are encapsulated into the process variables in the initial start component to obtain the target start component.

[0088] The start component disclosed in the present application describes the process definition based on the JSON data structure in the flowable workflow field, aiming to replace the traditional XML expression method, making the definition, deployment and operation of the process more flexible and facilitating expansion.

[0089] When executing a business process through this start component, only a small number of parameters, such as name or vehicle identification number, need to be provided, and then the start component of the present application can automatically query and load, and fill the results of the query of some unspecified variables into the process change variables.

[0090] A method for constructing and running a start component of the present application and a start component have the same technical concept, and the technical details of the embodiments of the two can be mutually applicable. To avoid repetition, they will not be elaborated here.

[0091] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each program module is used as an example. In actual applications, the above functions can be allocated to different program modules according to needs, that is, the internal structure of the device is divided into different program units or modules to complete all or part of the functions described above. Each program module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in a processing unit. The above integrated units can be implemented in the form of hardware or in the form of software program units. In addition, the specific names of each program module are only for the convenience of mutual distinction and do not limit the protection scope of the present application.

[0092] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concept. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

Claims

1. A method for constructing and running a start component, characterized in that It includes the following steps: Drag the target start component from the component library to the design process canvas; the target start component encapsulates the parameters of the http response into the process variables on the basis of the initial start component; Configure the http request message of the target start component; specifically including: configuring the resource path of the http request message, configuring the input parameter of the http request message, configuring the sending method of the http request message, and configuring the response mapping relationship of the http request message; Configure the process structure of the target start component, and deploy the configured process structure to the flowable engine so that it can be executed; After the process is initiated, the process automatically parses the detailed content of the target start component, automatically initiates an http request, and automatically stores the response result of the http request in the process variable.

2. The method for constructing and running a start component according to claim 1, characterized in that: It also includes building the target start component, specifically including: Design on the basis of the initial start component in XML format, and add several http request messages in JSON format; Use the flowable engine to identify the http request message in the initial start component and the detailed parameters of the http request message; the detailed parameters are stored in the database in JSON format; Concatenate the detailed parameters into a normal http request, send the http request to the flowable engine to obtain an http response; then encapsulate the parameters returned by the http response into the process variables in the initial start component to obtain the target start component.

3. The method for constructing and operating a start component according to claim 1, characterized in that, The configuration of the process structure of the target start component and the deployment of the configured process structure to the flowable engine so that it can be executed; specifically including: Read the unique identifier of the defined process and the identifier of the application to which the process belongs to generate the basic process structure; Read the http interfaces required in the process and their call methods, and create corresponding service task nodes for each http interface; Map the return value of the http interface to the form field through the response mapping relationship; Parse the response path in the return value of the http interface at runtime and dynamically assign the response path to the process variable.

4. The method for constructing and operating a start component according to claim 3, wherein, It also includes: Set the initialization of the global variables in the process by defining the form field and the initial value of the form field.

5. The construction and operation method of a start component as described in claim 4, characterized in that: Add or change the form field by adjusting the configuration of the response mapping relationship.

6. A method for constructing and operating a start component according to any one of claims 3-5, characterized in that: Adopt the JSON format to map the field name of the form field and the response path of the http interface; The http interface supports dynamically mapping multiple form fields.

7. The construction and operation method of a start component as described in claim 1, characterized in that, Initiate an http request through the httpTask component, and automatically store the response result of the http request in the process variable.

8. A method for constructing and running a start component according to claim 6, characterized in that: The httpMapper component automatically parses the response mapping relationship and sets process variables for subsequent nodes to use.

9. A method for constructing and running a start component according to claim 8, characterized in that: The httpMapper component extracts data from the response variable name and assigns it to the process variable.

10. A start component, characterized in that, The start component is the target start component in the method for constructing and running a start component according to any one of claims 1-9.