cancel
Showing results for 
Search instead for 
Did you mean: 

How to get extensionElements variable value if we have only taskId through API

krishnapatra
Champ in-the-making
Champ in-the-making
I'm using activiti with spring rest api. User will be having option to select any of its listed tasks and ask for the values of extensionElements. To do so, I'm making a rest call with taskid.
Is there a way to fetch value of extensionElements through taskId.

Below is my workflow:
         <userTask id="writeReportTask" name="Write monthly financial report" activiti:assignee="${assignee}" activitiSmiley Surprisedwner="${owner}">
            <extensionElements>
                <activiti:field name="clientName" stringValue="${clientName}" />
                <activiti:field name="companyName" stringValue="${companyName}" />
            </extensionElements>
          </userTask>

         <userTask id="financeReportTask" name="review monthly financial report" activiti:assignee="${assignee}" activitiSmiley Surprisedwner="${owner}">
            <extensionElements>
                <activiti:field name="clientName" stringValue="${clientName}" />
                <activiti:field name="companyName" stringValue="${companyName}" />
            </extensionElements>
          </userTask>

1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

Extension elements can be read from the BpmnModel object. So you could fetch the process definition XML and use the BpmnXMLConverter to transform it into a BpmnModel instance and then get the flow element with the task id. You can also fetch the BpmnModel as JSON with a REST service call http://activiti.org/userguide/index.html#_get_a_process_definition_bpmn_model.

Best regards,