Skip to content
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

Comment of Domain Object do not work #353

Open
smilucky opened this issue May 8, 2024 · 2 comments
Open

Comment of Domain Object do not work #353

smilucky opened this issue May 8, 2024 · 2 comments

Comments

@smilucky
Copy link

smilucky commented May 8, 2024

@stefan-ka hello
For library, getComment(SL_COMMENT and ML_COMMENT) on Bounded Context and Domain Object do not work, return null.

Below, getComment not work

 /*Custormer entity displayName*/
BoundedContext CustomerSelfServiceContext{
    Aggregate CustomerFrontend { // Customer Agg displayName
		Entity CustomerAddressChange {
			aggregateRoot
			- UserAccount issuer
			- Address changedAddress
		}
    }
}

model.getBoundedContexts().forEach(bc -> {
            System.out.println(bc.getComment());
            bc.getAggregates().forEach(aggregate -> {
                System.out.println(aggregate.getComment());
            });
        });

output: null null ...
@stefan-ka
Copy link
Member

Hi @smilucky

Thanks for reporting the issue! I am aware of that, but as far as I know its an Xtext issue (or feature, I'm not sure) we cannot really solve on our side. Comments (SL_COMMENT and ML_COMMENT) can be added to the grammar, but their content is not parsed and filled into the Ecore model. But I can check whether something changed here since I last stumbled over that one.

We also had this issue when we wanted to add decorators for our MDSL generator. We then solved it by adding a "doc" string on top of the Aggregate. An example can be found here: https://contextmapper.org/docs/mdsl/#microservice-api-patterns-map-decorators
This is however not available on all our objects (also not the Bounded Context).

What exactly is your use case? Could the example above be a workaround for you as well?

Best regards,
Stefan

@smilucky
Copy link
Author

Hi @stefan-ka

Thank you very much for your response. I tried the solution you suggested (using doc), and it solved 99% of my problem. My use case involves adding additional information to CML elements, such as names, descriptions, unsupported data types in CML, object relationships, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants