AnsweredAssumed Answered

Update Custom Property variable Through Alfresco Javascript

Question asked by pankajnegi on Mar 19, 2012
Latest reply on Mar 20, 2012 by pankajnegi
Hello Friends,
I wants to update custom task variable(model property) through the javascript.

As I am able to update the bpm model properties through the javascript like
execution.setVariable('bpm_workflowDescription', "My Custom Decsription");
but unabme to update my costom property.

As I have a model defined
<?xml version="1.0" encoding="UTF-8"?>

<model name="mcwm:momentOrderModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

    <description>Movement Order</description>
    <author>Pankaj</author>
    <version>1.0</version>  


<imports>
       <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"></import>
        <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"></import>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
        <import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"></import>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="mcwm.model" prefix="mcwm" />
   </namespaces>

<!– –>

<types>
   <type name="mcwm:moSubmitTask">  
   <parent>wf:submitReviewTask</parent>
     <mandatory-aspects>
            <aspect>mcwm:momentorder</aspect>
         </mandatory-aspects>  
   </type>

 
   <type name="mcwm:moReviewTask">  
   <parent>wf:activitiReviewTask</parent>
      <mandatory-aspects>
            <aspect>mcwm:momentorder</aspect>
         </mandatory-aspects>
   
   </type>
   </types>

<aspects>
    <aspect name="mcwm:momentorder">
        <properties>
            <property name="mcwm:projectName">
                <type>d:text</type>
       <mandatory>false</mandatory>
       <multiple>false</multiple>
            </property>
            <property name="mcwm:nextlevelassignee">
                <type>d:text</type>
      <mandatory>false</mandatory>
      <multiple>false</multiple>
            </property>
            <property name="mcwm:shortProjectName">
                <type>d:text</type>
            </property>
        </properties>
    </aspect>
</aspects>
<!– –>



</model>

which has a property name projectName

  <property name="mcwm:projectName">

which i wants to update through the alfresco javascript

execution.setVariable('mcwm_projectName',"My Custom Project");
logger.log(task.getVariable('mcwm_projectName'))(it returns My Custom Project).

but in review and aprove task form its showing mcwm:projectName: (None)


Please anyone let me know how these task variables(property) will get updated.



Thanks a lot
Pankaj

Outcomes