cancel
Showing results for 
Search instead for 
Did you mean: 

Show custom property along with Workflow Description

mitpatoliya
Star Collaborator
Star Collaborator
I want to show the custom property of my document which is attached in the workflow along with the workflow description which get displayed in the Task to do dashlet.
As this will help to identify the task by looking at the dashlet itself that which task is related to which document.
Any thoughts on this??
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
You will have to customize the way the workflow form works to make this happen. Maybe the easiest way would be to create a custom form control that knows how to figure out (or is passed) the document that has the property you want to display and then makes an AJAX call to retrieve that data.

I guess you'll have to decide which objects you want to grab properties from because workflow packages can obviously contain more than one document.

Jeff

mitpatoliya
Star Collaborator
Star Collaborator
hi Jeff,

Thanks for your quick response.
Actually I have created workflow for the webclient.So,I think workflow forms will not be there right?
And I am trying to do it with the help of process definition files only.
this is how I am trying that.
1) Extract the property from the document(as we can extract the properties of document in process definition file) and append that to the description.

   <start-state name="start">
        <task name="custom:startTask" swimlane="initiator">
        </task>
        <transition name="" to="grp1review">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <runas>admin</runas>
              <script>
              <variable name="custom_var" access="write"/>
              <variable name="bpm_package" access="read"/>
              <expression>
               var custom_var=bpm_package.children[0].properties["custom:property"];
               logger.log("custom_var VALUE issssssss "+custom_var);
            </expression>
              </script>
         </action>
        </transition>
    </start-state>
  
<task-node name="review">
  <task name="cust:reviewTask" swimlane="assignees">
        <event type="task-assign">
              <script>
                <variable name="custom_var" access="write"/>
                  <expression>
                    taskInstance.description = custom_var + " descripiton "+taskInstance.description;
                   </expression>
              </script>
           </event>          
        </task>
        <transition name="approve" to="review"/>   
         <transition name="reject" to="rejected"/>
      
    </task-node>

Even Logs are not getting displayed.

2)Then that description will be reflected in the dashlet directly.

Either the problem is in extracting the property or in passing it through variable.