cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco shows the right task title but fails to show task description

gpeter
Champ in-the-making
Champ in-the-making
Hi there,
Thanks to JPotts guide to advanced workflows i got a decent understandigs of how to exploit them and how to interact with them via webscripts.
Now I'm facing a problem that does not report any error log so i don't know how to fix it.
Basically i can give to the task the correct title via the messages/workflow.properties file, but from the very same file alfresco does not get the "description".
I have to use this and not share because i need to read them via webscript [ service/api/task-instances ].
In the end what i get is:

"name": "wpa:anagraficaTask",
"title": "Task's Title",
"description": "ThisIsTheNameFieldInActivityDesigner"

Instead of :

"name": "wpa:anagraficaTask",
"title": "Task's Title",
"description": "This should be the description"


So it reads workflow's name and description correctly, the task's name correctly but not the task description( note that "ThisIsTheNameFieldInActivityDesigner" is the Name form in the task properties in Activity Designer ).

Here are the configuration files (i have cut off redundant/optional parts to enhance readability […]):
context/service-context.xml:


[…]
<bean id="wpa.sciaWorkflowBootstrap" parent="workflowDeployer">
   <property name="workflowDefinitions">
      <list>
         <props>
         <prop key="engineId">activiti</prop>
         <prop key="location">alfresco/extension/workflows/scia.bpmn</prop>
         <prop key="mimetype">text/xml</prop>
         <prop key="redeploy">true</prop>
         </props>
      </list>
   </property>
    <property name="labels">
        <list>
            <value>alfresco.module.${project.artifactId}.messages.scia</value>
        </list>
    </property>
    <property name="models">
        <list>
            <value>alfresco/module/${project.artifactId}/model/wpaModel.xml</value>
        </list>
    </property>
   
</bean>


messages/workflow.properties :


[..]
wpa_workflowmodel.type.wpa_anagraficaTask.title=Task Title
wpa_workflowmodel.property.wpa_anagraficaTask.description=This should be the description


model/wpamodel.xml :

[..]
<model name="wpa:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
[..]
<!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />            
</imports>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
   <namespace uri="iconn.test.wrapperpa" prefix="wpa" />
</namespaces>
<types>

  [..]
   <type name="wpa:anagraficaTask">
            <parent>bpm:workflowTask</parent>
           
    </type>       
   [..]   
</types>   
</model>


user task section in the bpmn:

    <userTask id="usertask6" name="ThisIsTheNameFieldInActivityDesigner" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wpa:anagraficaTask">
        <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[logger.log("|=====1====| executing js di create anagrafica");
var node = bpm_package.children[0];
node.properties['wpa:idTask']=task.getId();
node.save();]]></activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[logger.log("|=====1====| executing js di complete anagrafica");
var node = bpm_package.children[0];
var link = "wrapperpa/showdaticatastali";
node.properties['wpa:link']=link;
node.save();]]></activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>


Any idea?
Am i doing something wrong or is this some sort of a bug that i should report?
Thank you.
5 REPLIES 5

romschn
Star Collaborator
Star Collaborator
Try doing it this way
wpa_workflowmodel.type.wpa_anagraficaTask.description=This should be the description
and see if it works for you or not.

Hope this helps.

gpeter
Champ in-the-making
Champ in-the-making
Thank you for you reply, but no sadly is not working.
That ".property." instead of ".type." was just one of the various attempt that i made trying to fix it.

romschn
Star Collaborator
Star Collaborator
That is strange. It should have worked ideally. Looking at your post, you mentioned that the properties are added in messages/workflow.properties file. However, in context.xml code snippet, i could not see it included. Please make sure that the above properties file is available in the context and verify if it works for you or not.

Hope this helps.

gpeter
Champ in-the-making
Champ in-the-making
I mentioned a messages/workflow.properties file in a abstract way, in the file system the file is properly called scia.properties.
And it works, since the tasks get their Title from it.
It just ignores the description field.
It happens when i launch the [font=Courier]integration-test -Pamp-to-war[/font] in eclipse and if I deploy the .war in a server using the [font=Courier]bin/apply_amps[/font].

jakepens71
Champ in-the-making
Champ in-the-making
My properties file does not correctly label everything either. I am not sure if this is a bug or we are doing something wrong.