Workflow Task get Documentation

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2016 04:19 AM
Hello!
I have a custom task like:
Now I want to get this documentation via Java API. "WorkflowModel" does not contain any property with "documentation", also the "WorkflowTask" itself does not contain any method like "getDocumentation()". I just find things like: "workflowTask.getPath().getInstance().getDescription()" or "workflowTask.getPath().getInstance().getDefinition().getDescription()" but nothing more.
Someone knows how to get the documentation of a task in Java?
I have a custom task like:
<userTask id="usertask1" name="User Task 1" activiti:assignee="${initiator.properties.userName}"> <documentation> This is the documentation and I want it </documentation> …</userTask>
Now I want to get this documentation via Java API. "WorkflowModel" does not contain any property with "documentation", also the "WorkflowTask" itself does not contain any method like "getDocumentation()". I just find things like: "workflowTask.getPath().getInstance().getDescription()" or "workflowTask.getPath().getInstance().getDefinition().getDescription()" but nothing more.
Someone knows how to get the documentation of a task in Java?
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2016 06:26 AM
Hello,
using the Alfresco API you cannot get to that field. There simply is no mapping for it. Only via low-level Activiti API can you get to it, i.e. by developing a task listener that copies the "documentation" value to an Alfresco task model property when the task is created.
Regards
Axel
using the Alfresco API you cannot get to that field. There simply is no mapping for it. Only via low-level Activiti API can you get to it, i.e. by developing a task listener that copies the "documentation" value to an Alfresco task model property when the task is created.
Regards
Axel

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2016 07:28 AM
Oh, thanks that helped me a lot. Searched everywhere for hours


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2016 04:56 AM
workflowTask.getDefinition().getNode().getDescription() should be the documentation if it is set in the bpmn definition. The ActivitiTypeConverter maps it within the getNode method.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2016 03:56 AM
You are right - the workflowTask.getDefinition().getNode().getDescription() actually maps to the documentation, but this appears to be sheer luck / accident. Along the execution path, every variable referring to the value is called "description" and only the ActivitiConstants.NODE_DESCRIPTION constant contains the non-sensical value "documentation", so it ends up mapping that as a "pseudo-description". This is kind of dirty and I would not rely on it always staying this way.
