Assign all values of enumeration Type

Posted by jromagos on 04-Oct-2017 06:03

Hi,

I have an entity Field with a relation 1 to many with fielData.

I want to know if is there's a way to create as many new fieldData as all values of an enumeration.

As I show in this image in the second column.

Thanks in advance

Posted by jan@nimblecg.com on 04-Oct-2017 09:55

Another option if the list is (very) long is to (manually) create the list of actions in your favourite text editor and then use cut/paste to populate the action section of the rule sheet. You can open (a copy of) the ecore file in the editor, find the definitions of the CDT in the ecore file, copy that part to a new file, and do some text manipulation with that to define the requested format of the actions. Of course you need to be comfortable manipulating text in text editors. Also PLEASE make sure that you are not editing (and saving) the ecore file outside of the vocabulary editor since that may potentially break the vocabulary in Corticon!

On a non-related note, the syntax for the CDT values is not correct in the screen shot. Instead of using the dot notation as is used in Java (enum.label), in Corticon you should use a hash tag: cdtName#cdtLabel. This is the correct supported syntax.

Posted by Harold-Jan Verlee on 04-Oct-2017 07:15

Unfortunately Corticon doesn't allow you to iterate through the list of defined enumeration elements in the vocabulary to create all your data in one action row. Your rules will need to create the necessary FieldData based on the enumeration values (as you have done in the example). Alternatively, you could build a standalone operator extension using the CorticonFoundation.jar found on ESD, to iterate programmatically through your enumerations for the custom datatype in the rulesheet's corresponding vocabulary. But that seems a lot of effort compared with the rules you already created. :-)

All Replies

Posted by Harold-Jan Verlee on 04-Oct-2017 07:15

Unfortunately Corticon doesn't allow you to iterate through the list of defined enumeration elements in the vocabulary to create all your data in one action row. Your rules will need to create the necessary FieldData based on the enumeration values (as you have done in the example). Alternatively, you could build a standalone operator extension using the CorticonFoundation.jar found on ESD, to iterate programmatically through your enumerations for the custom datatype in the rulesheet's corresponding vocabulary. But that seems a lot of effort compared with the rules you already created. :-)

Posted by jan@nimblecg.com on 04-Oct-2017 09:55

Another option if the list is (very) long is to (manually) create the list of actions in your favourite text editor and then use cut/paste to populate the action section of the rule sheet. You can open (a copy of) the ecore file in the editor, find the definitions of the CDT in the ecore file, copy that part to a new file, and do some text manipulation with that to define the requested format of the actions. Of course you need to be comfortable manipulating text in text editors. Also PLEASE make sure that you are not editing (and saving) the ecore file outside of the vocabulary editor since that may potentially break the vocabulary in Corticon!

On a non-related note, the syntax for the CDT values is not correct in the screen shot. Instead of using the dot notation as is used in Java (enum.label), in Corticon you should use a hash tag: cdtName#cdtLabel. This is the correct supported syntax.

Posted by jromagos on 05-Oct-2017 02:27

Hi,

More or less it was the solution, first create the output with my text editor an then copy directy to corticon Studio output.

Thanks for your help!

This thread is closed