Update the value of a property from custom model

cancel
Showing results for 
Search instead for 
Did you mean: 
antonio_sanchez
Active Member

Update the value of a property from custom model

I have a custom aspect with a property like:

<aspect name="cofc:process">
   <title>Process</title>
   <properties>
      <property name="cofc:process">
         <title>Process</title>
         <description>Name of the process</description>
         <type>d:text</type>
         <mandatory>true</mandatory>
         <index enabled="true">
            <tokenised>TRUE</tokenised>
            <facetable>false</facetable>
         </index>
         <constraints>
            <constraint name="cofc:LIST_3f87a64c-c3f8-4939-888f-9f64b985392e" type="LIST">
               <parameter name="allowedValues">
                  <list>
                     <value>Join the association</value>
                     <value>Edit profile</value>
                     <value>Leave the association</value>
                  </list>
               </parameter>
               <parameter name="caseSensitive">
                  <value>true</value>
               </parameter>
               <parameter name="sorted">
                  <value>false</value>
               </parameter>
            </constraint>
         </constraints>
      </property>
   </properties>
   <associations/>
   <overrides/>
   <mandatory-aspects/>
</aspect>

The users have created some documents and they have assigned the value "Edit profile" to the property "Process".

I have noticed that changes in the list of values of the custom model are not reflected in the old documents. I mean, if I change the value "Edit profile" to "Edit user" in the custom model, the old documents have no changed the value to "Edit user".

Is there any way that a change in the model causes an automatic change in all affected documents?

3 Replies
krutik_jayswal
Senior Member II

Re: Update the value of a property from custom model

Existing document will not get updated when you update the content model.

You need to write patch for this.You can study it on below link.

Patches | Alfresco Documentation 

cesarista
Customer

Re: Update the value of a property from custom model

Hi:

In addition, this would be somehow possible if you used i18n in constraint lists in a bootstrap content model, changing the values (but preserving the original keys).

It seems that you use model manager, but what it is not clear for me is how do you changed the model (deactivate-change-activate) with existing data.

Regards.

--C.

antonio_sanchez
Active Member

Re: Update the value of a property from custom model

Hi!

I have created del custom model using the Model Manager, so in order to change the model I have to deactivate-change-activete as you say.

Thank you.