New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] What are the main files responsible for generating an app's views, through ifmlEdit? #38
Comments
Hi. First of all, you should take a look at https://github.com/B3rn475/almostjs which is the Model-to-"Anything" framework that is used by the project.
The main concept you need to know about is "there are different types or Rules".
There are a few papers linked in the ALMOsT repository. IFMLEdit.org uses these libraries as follows:
All of them follow a Model To Text approach, see These generators generally use Model Rules to generate global files that cannot be mapped to a specific element. E.g. the From a practical standpoint the Model Rules are stored in Taking a deeper dive into the rules you will notice that they are split into 2 functions. The first one decides if the rule applies, by returning a boolean, while the second actually generates the files/folders needed. For practical purposes rules are generally implemented in 2 phases:
Now back to what you want to doDepending on what you care about you may want to use either If your rules are simple and easy to write, you could probably be happy already here. But if you are having troubles... How you can manage complexityDepending on the complexity of what you want to do, you may even want to split your transformation in multiple stages. Reasoning directly on IFML may be complicated in some cases. A simple, but meaningful example.
If the original meta-model supports If you have the guarantee that you will only have You can make your life easier by adding an intermediate Model-To-Model transformation that makes almost everything pass through "as-is", but transforms With ALMOsT this scenario is really easy In your specific case, you can have the existing
Let me know if you have more questions. |
Thank you very much, I'm glad to know that much of what I could infer just by analyzing the project is in fact valid. I've also read all the major articles related to almost and its components to understand how Ifmledit uses its rules. I intend to perform my implementation using the "server" transformation. |
At first I intend to add new rules to the existing structure in order to reduce the initial implementation complexity. If necessary, I will be separating the new rules into a separate structure, but for this moment I will worry about leaving it working. |
@B3rn475 I recently created a transform rule that should utilize the existing IFML transform framework. This rule should map the elements of an ifml template to a Cypress test script using the "form" stereotype. I also added the scripts template that should receive the data to assemble the script. However, when running the application, nothing is generated, as if the model data were not being provided to the template at the time of transformation. You could clone my fork, or just analyze my source code to suggest changes and/or show where I'm going wrong. |
I would also like to know a way to debug the application code, since it is currently executed through the assets compiled using gulp routines. Maybe debugging the real-time execution flow would help me identify what's going wrong with my code. |
You can easily debug the transformation in the browser. Just open the developer tools, find the file/line you care about in the source code and add a breakpoint. |
@B3rn475 I've been studying the structure and behavior of ifmlEdit, in order to understand the entire flow of its operation, and despite the project being well organized and with very lean functions, it is so well structured that the abstraction of certain functionalities is not so easy. I have a hunch which files are responsible for the ifml transformation rules for the views code, but I would like to be more sure. If possible, could you explain to me or provide me with some kind of existing documentation related to this functionality. As I mentioned, I intend to add rules for generating interface test scripts for Cypress, but I need to understand as much as possible how the interfaces themselves are built based on a IFML model.
The text was updated successfully, but these errors were encountered: