cancel
Showing results for 
Search instead for 
Did you mean: 

Update Custom Property variable Through Alfresco Javascript

pankajnegi
Champ in-the-making
Champ in-the-making
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="mcwmSmiley TonguerojectName">

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 mcwmSmiley TonguerojectName: (None)


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



Thanks a lot
Pankaj
2 REPLIES 2

pankajnegi
Champ in-the-making
Champ in-the-making
Hello ,
I Can update the task properties for the bpm type as

<parent>bpm:startTask</parent>

<parent>bpm:activitiOutcomeTask</parent>


bpmModel.xml
• bpm:task!
• bpm:workflowTask!
• bpm:startTask!
• bpm:activitiStartTask!
• bpm:activitiOutcomeTask!

workflowModel.xml
• wf:submitAdhocTask!
• wf:reviewTask!
• wf:activitiReviewTask!
• wf:approvedTask!


so my question is can we use BPM for reviewing the task and how..?


Thanks

pankajnegi
Champ in-the-making
Champ in-the-making
Hello everyone ,

Is it not possible..?

I am new to alfresco

please reply


Thsnks