Suggested strategy to generate concepts

I need to generate concepts (for the PE4MPS project but the problem is not project specific) in a persistent way, I mean not as transient object. Once you have a concept you can create nodes of that concept.
The problem araise when the concept gets genereted again: the nodes of that concept could lost the referenced concept if the concept is deleted then recreated.

What's the suggested strategy in this case? Programmatically one can, in theory, search for the concept to generate and do not create new ones if it exists.
With a generator the process will be much more clear but can a Generator updates nodes instead of always generated new ones?

Thanks,
Mar
2 comments
Your first strategy would be possible if you don't find a better one:

if(!model.nodes(<all>).any({
~node => NodesMatcher.matchNodes(node, newGeneratedNode) == null; })){
addNewNode();
}
prettyPrint();
0
The first one is the strategy that quickly could be used by PE4MPS because concepts are now created programmatically without checking for existence, however I did not know the API you posted, thanks.

Without any other hint I will use this strategy because I can't imagine a similar use of the Generator aspect.
0

Please sign in to leave a comment.