cancel
Showing results for 
Search instead for 
Did you mean: 

Create a new version of a document

rodrigoa
Champ in-the-making
Champ in-the-making
Hello everybody,

I would be grateful if someone could help me with me problem.

When I start my workflow, a document need to go from one site to another, but I am getting a error message when I try to start the workflow using one document that is already in the final site. Is it possible to create a new version of this document automatically? I mean, is it possible to subscribe the old document by the new one?

Thanks in advance,

Rodrigo Araujo
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
Sorry,   what do you mean by "subscribe"?    If you mean "update" then that is very possible.  

And if the destination node has the "versionable" aspect defined then a new version will be created automatically.

rodrigoa
Champ in-the-making
Champ in-the-making
Hi MRogers,

Update is the exactly word I needed to have used.

Could you help me with this "versionable" aspect?

I tried to change the contentModel.xml like abouve, but did not work:

      <type name="cm:content">
         <title>Content</title>
         <parent>cm:cmobject</parent>
         <archive>true</archive>
         <properties>
            <property name="cm:content">
               <type>d:content</type>
               <mandatory>false</mandatory>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>false</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
         </properties>
        <mandatory-aspects>
           <aspect>cm:versionable</aspect>
        </mandatory-aspects>
      </type>

Thank you very much,

Rodrigo Araujo

rodrigoa
Champ in-the-making
Champ in-the-making
Hi all,

continuing my questions, now I am creating the new versions of a document, the only problem now is that I can not copy the text inside. I am trying like this:

var workingCopy = targetFile.checkout();
workingCopy.content = bpm_package.children[0].content;
targetFile = workingCopy.checkin();

I would be very grateful with any kind of help,

Thanks,

Rodrigo Araujo.

rodrigoa
Champ in-the-making
Champ in-the-making
Hi all,

I solved my problems with this:

workingCopy.properties.content.write(trans.properties.content);

Thanks,

Rodrigo Araujo.