cancel
Showing results for 
Search instead for 
Did you mean: 

Add values to cm:storeSelectorConstraint

frontman
Champ in-the-making
Champ in-the-making
Hi,

I'm testing alfresco2castor and have a little problem when I run the following script:

logger.log("Storing document in the CAStor cluster");

if (!document.hasAspect("cm:storeSelector"))
   document.addAspect("cm:storeSelector")

document.properties["cm:storeName"] = "castor";
document.save();

Then appears this exception:

Failed to run Actions due to error: 02150014 Found 1 integrity violations: Invalid property value: Node: workspace://SpacesStore/493584cc-392a-48d0-be63-fb50632bed9d Type: {http://www.alfresco.org/model/content/1.0}storeSelector Property: {http://www.alfresco.org/model/content/1.0}storeName Constraint: 02150013 The value is not an allowed value: castor


I checked contentModel.xml, where there is a constraint called "cm:storeSelectorConstraint" and its type is "REGISTERED", which is applied to  "cm:storeName" property of "cm:storeSelector" aspect. I'm not sure if I'm looking in the right place but I would like to know where I can add more values to this constraint and if that would help to avoid this exception.

Regards.
1 REPLY 1

lsharmaa
Champ in-the-making
Champ in-the-making
hi

you can add list values in appropriate content model file. you can define a property and create constraint name. so in that constraints name you can add the values.

say for ex:
<property name="bpm:commentType">
      <type>d:text</type>
      <constraints>
         <constraint ref="bpm:commentTypeList" />
      </constraints>
      </property>
<constraint name="bpm:commentTypeList" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>copy</value>
               <value>subject</value>
               <value>General</value>
               <value>Unknown</value>
            </list>
         </parameter>
      </constraint>