cancel
Showing results for 
Search instead for 
Did you mean: 

Adding aspect to out of box workflow in share

sradha
Champ on-the-rise
Champ on-the-rise
Hi,

I have created custom model.I want to add an aspect value to noderef as approve while the user approve a document using  out of box "Review and Approve" workflow.Can anybody help?
3 REPLIES 3

jpfi
Champ in-the-making
Champ in-the-making
Hi,
you'll have to tweak the standard workflow process, e.g.:
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
                  <activiti:field name="script">
                     <activiti:string>
                       //…add approved aspecct
                  bpm_package.children[0].addAspect("cm:approved");
                  bpm_package.children[0].properties["cm:approvedAt"]= new Date();
                  bpm_package.children[0].save();
                     </activiti:string>
                  </activiti:field>
               </activiti:taskListener>
More about Alfresco & Workflows: http://ecmarchitect.com/images/articles/alfresco-workflow/advanced-workflow-article-2ed.pdf
cheers, jan

sradha
Champ on-the-rise
Champ on-the-rise
Hi Jan,

Sorry.I have not produce my requirement correctly. I have created a custom model in share.Then create content based on that model and applied aspect value.I have started default workflow "Review and Approve" for  it.My requirement is to display the applied aspect to the noderef in the start workflow Ui and also able to update the value while approved by the reviewer.Is it possible? Please help me.



Regards,
Sradha

dasu
Champ in-the-making
Champ in-the-making
Did you able to sort this out? I want to do the same thing and I don't know how to add a new aspect there? I know the way to create custom aspects and add them to document library. How to add the custom aspect to existing workflow?