Old is not always gold
Workflows are part of our lives. A workflow is defined by a sequence of activities to achieve a specific goal. They often become routine and are repeated regularly. As an example: We all have a morning routine – get up on time, take a shower, have a breakfast, etc. But we all know the situation: once workflows have been established, they are not changed so quickly. This is often justified by the fact that there is no obvious reason to revise the existing workflows. With Release 2024-B, dSPACE gives you this reason because Model Compare 2024-B now provides a way to work more efficiently with more quality for equal or less cost. In this blog, we give you a brief overview of how you can use our new command line interfaces (CLIs) in your daily work to improve your well-established model-based workflows to make them easier and more efficient.
What’s new?
With Model Compare 2024-B, three new CLIs are provided:
DiffImagesScriptGenerator
Creates different files including an XML report and MATLAB® scripts to create images which are used for generating a new interactive HTML report, regardless of your environment, which can be either local or continuous integration (CI)/continuous delivery (CD).
MocXml2InteractiveHtmlDiffReport
Generates a new interactive HTML report with images from the files generated by the DiffImagesScriptGenerator specially designed to improve model reviews, e.g., to enable reviewers in pull request reviews to identify relevant changes fast and verify them. '
MergeScriptGenerator
Creates a MATLAB® script containing merge commands which can be executed to perform a comfort copy. On CI/CD systems, the generated MATLAB® script helps you perform an automatic merge in the currently running MATLAB® instance, to speed up the process.
Smart and reusable workflow steps with Model Compare
Our new CLIs allow you to work in your familiar MATLAB® environment by using the generated MATLAB® scripts in an appropriate pipeline, independently of a CI/CD system. But whether you work in a CI/CD system or locally, our new workflow steps and their technical implementation are the same. There is no need for additional implementation efforts when changing between working locally or in a CI/CD system. So you can run our workflow steps locally and they will behave in the same way in the CI/CD system. This also means you can develop and test directly with your locally installed MATLAB® version to reduce errors and realize a higher quality, in an early stage of development. It also reduces the implementation efforts regarding your software development. You can execute our workflow steps in an already initialized MATLAB® session. There is no need for multiple MATLAB® starts. This speeds up the process on the CI/CD system and allows you to integrate and deliver your software more frequently. The following examples illustrate the use of our new CLIs in two different workflows:
Workflow I: Review model file changes in pull request workflows
In a first step, some Git tasks are necessary to provide the appropriate model files for comparison. In a second step, the dump files are created using the Model2DumpConverter (or ds_mdl2xml). From these files, we generate our new interactive HTML report: With the DiffImagesScriptGenerator, files are generated that are needed to create an interactive HTML report using the MocXml2InteractiveHtmlDiffReport CLI. This report shows the differences between the compared model files. You can use it in pull request workflows to enable efficient model reviews.
Workflow II: Resolve model conflicts automatically with merge commands
We provide a CLI for merge script generation. This MergeScriptGenerator CLI allows you to initiate merge operation workflows from MATLAB®. It is very similar to the previously described workflow. After creation of the dump files, the MergeScriptGenerator CLI is called to create a script containing the merge commands. Execute the generated script directly in MATLAB® to make an automatic comfort copy and resolve model file conflicts without any user interaction.
It’s never too late for new beginnings
With the new Model Compare CLIs, dSPACE gives you the chance to let today be a new beginning with a better flow: Use these new CLIs to improve the model-based workflows you use every day and – as a result – your work is done even faster.
It's certainly difficult to change your morning routine. But there are often good reasons to do so – maybe the new routine of getting up on time, having a breakfast, and then taking a shower is much more efficient? Perhaps we have now given you reasons to think about your model-based workflows and the possibilities that Model Compare 2024-B offers to you.
By the way, the new CLIs can also be used to build up complete model-as-code workflows to treat models as efficiently as code in well-known code-based workflows in terms of automation, reproducibility, and collaboration. And this new way of working can also support you massively in the development of your solutions, e.g., for the software-defined vehicle (SDV).
So let the work flow! If you have any questions or need further support to integrate the new CLIs in your workflow, feel free to contact us.
Simone Schmücker
Technical Author, R&D Governance & Competence Partners - User Documentation & Language Services