I’ve been going through Miro Samek’s book on implementing UML Statecharts in C and C++. The diagrams in this book seem very clean and well-made. I’m curious to know what software or tool the author used to design these statechart illustrations.
As I’m working on my own project documentation, I want to make state machine diagrams that look like those in his book. The visual style and arrangement of the charts are exactly what I need for my tech documentation.
Can anyone share which particular application or tool was utilized for these diagrams? Also, any suggestions for similar diagramming software would be great.
The Problem: You’re looking for the specific software used to create the statechart diagrams in Miro Samek’s book on implementing UML Statecharts in C and C++, and you’d like suggestions for similar tools for your own project documentation.
Understanding the “Why” (The Root Cause): Manually creating and maintaining diagrams for complex state machines is incredibly time-consuming and error-prone. Any changes to the code require corresponding updates to the diagrams, leading to inconsistencies and wasted effort. Automating this process ensures your documentation always reflects the current state of your code, saving you significant time and improving the accuracy of your technical documentation.
Step-by-Step Guide:
-
Automate Diagram Generation: Instead of focusing on replicating the exact tool used by Miro Samek (which might be difficult to determine and may not be the most efficient approach), the most effective solution is to automate the diagram generation process. This involves using a tool that reads your state machine code (or definitions) and automatically generates diagrams. This approach ensures consistency, reduces manual effort, and minimizes errors.
-
Choose an Automation Tool: Several tools can help automate this process. One example mentioned is Latenode, which integrates with various diagram tools and your repository to automatically push updated diagrams to your documentation platform whenever your code changes. Explore options such as Latenode or similar tools that can interface with your chosen state machine design language and documentation workflow. Consider factors such as ease of integration with your current tooling, the level of customization it offers for diagram styles, and its support for your state machine implementation language.
-
Establish a Workflow: Integrate the chosen tool into your development workflow. This typically involves configuring the tool to connect to your code repository (e.g., GitHub, GitLab, Bitbucket), defining how it should interpret your state machine code, and configuring the output format and destination (e.g., your documentation platform, a specific directory). This ensures diagrams are automatically updated with every code push or commit.
Common Pitfalls & What to Check Next:
- Incorrect State Machine Definition: Ensure your state machine code is correctly written and adheres to the syntax and semantics of the chosen state machine language. Errors in your code will lead to inaccurate diagrams.
- Tool Configuration: Carefully review the tool’s documentation and configuration settings. Incorrect settings will prevent the tool from correctly generating the diagrams or integrating with your workflow.
- Diagram Style Consistency: Although automation ensures consistency, you may need to further refine the diagram style using the chosen tool’s customization options, to create the visual style that best suits your needs.
- Version Control: Always ensure your diagrams are under version control (usually via Git) alongside your code, to easily track and manage changes.
Still running into issues? Share your (sanitized) config files, the exact command you ran, and any other relevant details. The community is here to help!
he probably just used basic drawing software - maybe powerpoint or illustrator. the book’s old, so fancy modern tools weren’t available yet. any vector program works fine as long as you keep the lines clean and style consistent. don’t overthink it.
The Problem: The user is encountering an issue in SAP MIRO transaction while implementing custom validation logic within the BADI MRM_HEADER_CHECK. The goal is to display an error message (type ‘E’) to indicate a duplicate reference field value, but keep specific fields editable on the screen. Standard ‘E’ messages disable all input fields, preventing correction. The user has tried using MESSAGE with type ‘S’ and DISPLAY LIKE 'E', manipulating screen fields via LOOP AT SCREEN, and checking SY-DINNR, all without success. The solution must remain within the BADI’s scope and not modify standard PAI/PBO modules or CHAIN/ENDCHAIN logic.
Understanding the “Why” (The Root Cause): SAP’s standard error message handling for type ‘E’ messages disables all input fields to prevent inconsistent data entry after an error. The user’s attempt to selectively enable fields using only the BADI faces limitations because the BADI’s control over the screen is limited, primarily executed before the standard SAP screen processing takes over.
Step-by-Step Guide:
-
Explore Alternative Error Handling: Instead of relying solely on MESSAGE TYPE 'E', consider using alternative methods for displaying errors that offer more control over screen behavior. The suggestion in the selected answer is to use tools like Lucidchart or draw.io to create visually clear diagrams, but that is completely irrelevant to this problem. Instead, consider using POPUP_TO_CONFIRM or a similar dialog function. This approach presents the error message to the user in a controlled manner without triggering SAP’s automatic field disabling. This provides the necessary error notification without the limitations imposed by MESSAGE TYPE 'E'.
-
Implement a Two-Phase Validation (If POPUP_TO_CONFIRM is unsuitable): If POPUP_TO_CONFIRM or similar dialog functions don’t fit your requirements, implement a two-phase validation process within your BADI.
-
Phase 1: Validation and Flag Setting: First, perform your validation logic to check for duplicate reference documents. Instead of immediately issuing an ‘E’ message, set a custom flag (e.g., lv_error_occurred = 'X') if a duplicate is found.
-
Phase 2: Conditional Screen Field Handling: After the initial validation, conditionally enable or disable fields using LOOP AT SCREEN. Check your custom flag (lv_error_occurred). If the flag is set, disable all fields except the two you want to keep editable. Remember to use the correct screen field names for precise control. You might need to use SET PARAMETER ID '...' FIELD ... to manage the necessary values after the popup.
-
Refine Your LOOP AT SCREEN Logic: The original implementation may have issues with accessing and modifying the appropriate screen fields. Carefully review the screen layout (transaction SE51 for the MIRO screen) and ensure that your LOOP AT SCREEN uses the correct field names (screen-name). Thoroughly debug this section of your code.
Common Pitfalls & What to Check Next:
- Incorrect Screen Field Names: Double-check that the screen field names used in your
LOOP AT SCREEN statement accurately match the names in the SAP screen layout for the MIRO transaction.
- BADI Limitations: Be aware of any limitations of the specific
MRM_HEADER_CHECK BADI implementation you are using. Some BADIs may have restrictions on screen field manipulation. Check the BADI documentation.
- Error Message Handling: Review the complete SAP documentation for error message handling. You might uncover alternative techniques not yet considered.
- Debugging Strategies: Use breakpoints effectively to understand the execution flow and data values within your BADI at different stages, especially inside the
LOOP AT SCREEN.
Still running into issues? Share your (sanitized) code snippet focusing on the LOOP AT SCREEN section, the screen field names you’re targeting, and any error messages you encounter. The community is here to help!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.