## 7 System Architecture and Implementation
### Process Chain Module  
Within the Process Chain module, the process chain is formulated as a configuration problem by a CSPs. The class csp provides the basic possibility to model a CSP. For this purpose, this class has the following attributes: Domains, which contain the possible values for each variable as a dictionary, and a Constraints list, which contains all constraints as objects of a constraint class. A constraint object has, among other things, the attributes, variables involved, the constraint equation as a function, the degree of the constraint (e.g., unary, binary, higher order), the type of constraint (\"hard\" or \"soft\"), and the cost of suppressing the constraint when relaxing soft constraints. The function is_satisfied() can be used within the constraint to check whether the constraint is satisfied given a value assignment. In addition, the csp class also has methods such as add_domain() to add a new domain, add_domain() to change a domain, and add_constraint() to add a new constraint. The add_constraint() method checks if all variables in a constraint are also present in the CSP, creates the constraint function, determines the degree of the constraint, and adds the constraint to the constraints list. Using the create_graph function also create graph object to the constraint net, which contains the variables and constraints of the CSP as nodes and edges. For this purpose the library NetworkX [53] is used. With the class csp general CSPs can now be formulated. Based on this, the process chain can be modeled by the classes process_container and process_chain.  
The process_container class represents a single process within the process chain and contains the name, csp, input_variables, and output_variables attributes. The variable csp is an instance of the csp class that contains the CSP formulation for this process. Furthermore, the variables input_variables and output_variables describe the names of the input and output variables of the process, respectively. The load_csp_from_excel function transfers a user-friendly formulation of the variables and constraints of a process in Excel into a csp object. The process_chain class describes the process chain as a whole and contains the processes and csp attributes, among others. The processes is a list of process containers containing the processes of the chain. The csp attribute is an instance of the csp class that contains the CSP formulation for the entire process chain. In addition, the process_chain class contains two methods: check_process_compability and add_process. The add_process method adds a new process to the process chain and transfers the domains and constraints of the process to the process chain. The check_process_compability method also checks whether two successive processes are compatible with each other by comparing the output_variables of an upstream process with the input_variables of a downstream process. Besides, both the process_container and process_chain class have the solve_CSP method, in which an object of csp_solver class is created to solve the CSP. Due to the fact that the process containers can be solved independently of each other, it is later also possible to implement a distributed CSPs to get a better computational performance for complex problems [54]. This structure of the process chains by process containers makes the dynamic configuration of Tailored Forming process chains possible, in which the static process chain default is dissolved by the user by a process chain with suitable heuristics on the basis of which the examined construction unit is derived and automated. In addition, different process chain variants can also be examined and evaluated against each other.