## 7 System Architecture and Implementation  
The system architecture and implementation of a knowledge-based system are crucial to create a robust and reliable assistance system. In this context, Python is one of the preferred programming languages because it is used by many developers, it allows for the integration of a large number of external libraries, and it has an interface to commercial CAD systems. Therefore, the entire system is computer-implemented in Python. To describe the system architecture and implementation, Figure 10 lists the activities for implementing the manufacturing stage model in a flowchart. Here, the user starts by manually building a CAD model for the tailored-forming part under investigation. At the same time, the user defines the manufacturing process chain with the part shape and specifies which process steps form the process chain in which order. The user interacts via a web-based interface hosted on a Flask server [51], which enables a user-friendly deployment within the development process.  
Based on this, a CAD module examines the geometry model of the tailored-forming component under investigation and reads out the relevant geometry parameters as well as the joining zone design. For this purpose, the CAD system Autodesk Inventor is used, since this system has an extensive interface that can be controlled with Python. Alternatively, other CAD systems can be used that have a similar interface. The joining zone information is then provided to a case-based reasoning module. This module searches for similar designed joining zones within an empirical or simulated case base and identifies feasible value assignments for some domains. With this and the previously defined process chain, the process chain configuration problem is built as a CSP within a process chain module. For this, the necessary variables with their domains as well as the constraints are created in the CSP and the domains are set according to the results from the case-based reasoning. The initiated CSP is then solved with a CSP solver module. This module considers different algorithms for constraint propagation and solution search. If a solution is found that satisfies all constraints, the identified value assignments are returned to the CAD module. By linking to the CAD system Inventor, the configured manufacturing steps can be modeled and made available to the user as a download via the Flask interface. If no solution is found by the CSP Solver module, the CSP Conflict Solver is activated. It identifies the conflicting constraints and resolves these conflicts by opening the domains of the involved variables either on the resource or on the component side. This expands the solution space and CSP Solver module starts solving the CSP again. The decision of whether to solve on the component or resource side is made by the user. The domains can also be opened step-by-step to avoid high computation time in case the domains are too large. This process for conflict resolution can be performed several times to identify alternative solutions. After the program flow was introduced with Figure 10, the implementation of the five modules  
Figure 10: Activity diagram of the system.  
is discussed. An object-oriented approach is pursued, since this makes a high modularity possible by independent program units, as well as the reuse of classes and functions as well as the inheritance of classes and thus the maintainability and expandability of the program facilitates. The conversion of the modules into responsible classes can be taken from the class diagram in Figure 11. These are introduced in the following after the modules.