cancel
Showing results for 
Search instead for 
Did you mean: 

using task properties in a workflow script

heck
Champ in-the-making
Champ in-the-making
Sorry the short post, but i can really boil down the question to:

How can i put information into a taskInstance (from a webscript) that i can use in the next workflow ScriptTask.

Like:
Webscript:

task = worklfow.getTask(id);
task.properties.wf_reviewComment = "blabla";
task.endTask("next");
Workflow:

activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
               <activiti:field name="script">
                  <activiti:string>
                     <![CDATA[<import resource="classpath:alfresco/extension/templates/webscripts/UBXLib/UBXUtils.js">]]>
                     logger.error("Workflow: reviewTask, complete");
content = task.getVariableLocal('wf_reviewComment');
                        addComment(node, title, content);
                     </activiti:string>
               </activiti:field>
            </activiti:taskListener>

I really cant list all the ways i tried, I could not get it working.

Is this supposed to work anyhow or do i get the concept wrong?

Using community edition 4.0b

Thanks a lot for any help

Best Regards
Matthias Heckmann
2 REPLIES 2

heck
Champ in-the-making
Champ in-the-making
Ok, update.

Just had another problem when i wanted to update the properties of a task instance.

The problem seems to be known as described in JIRA:
https://issues.alfresco.com/jira/browse/ALF-12661

So that generally means that currently you cant update task.properties using the JavaScript API.

if somebody could confirm:
1. that the issues are related
2. that my interpretation of the mentioned JIRA issue is correct

I am using alfresco community 4.0.b

Best Regards
Matthias Heckmann

mitpatoliya
Star Collaborator
Star Collaborator
Yes It looks similar.
Also,Check the comments given in the issue.
You can do it via JAVA then