cancel
Showing results for 
Search instead for 
Did you mean: 

Form properties vs variables activiti 5.18

ilansch
Champ in-the-making
Champ in-the-making
Hi all,
I want to get historic data of finished processes.
I have edited acitiviti-custom-content.xml in both webapps (activiti-rest,activiti-explorer) with new property:
<blockcode>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="history" value="audit" />
..
</blockcode>
I am working with MS-SQL database (set db.properties).

I created the model via activiti-explorer, so the variables are defined as Form-properties.
To complete a task, I use rest api, send parameter Variables in the HTTP Content, After i completed the task:
I run Get request:
http://localhost:1248/activiti-rest/service/history/historic-variable-instances -> returns the variables
http://localhost:1248/activiti-rest/service/history/historic-task-instances - show finished tasks but variable list is empty
http://localhost:1248/activiti-rest/service/history/historic-process-instances - show finished process but variable list is empty

What am i doing wrong ? Why i dont see the variables in task-instances get historic
Should we define the form-properties as variables ? When i create the form property i also enter a variable as the form propery id:
<blockcode>
<userTask id="Mission1" name="Mission1" activiti:assignee="kermit">
<extensionElements>
<activiti:formProperty id="FP2" name="FP2" type="string" variable="FP2" required="true"/>
</extensionElements>
</userTask>
</blockcode>
I have read in the API that i need to add includeProcessVariables or includeTaskLocalVariables –> 15.8.12. Get historic task instances
GET history/historic-task-instances. But when i run
http://localhost:1248/activiti-rest/service/history/historic-task-instances?includeTaskLocalVariable...
I also dont get variables.




Thanks
2 REPLIES 2

hari
Star Contributor
Star Contributor
Hi,

Have you tried it with the below request ?
GET runtime/process-instances/{processInstanceId}/variables
Read more here : http://activiti.org/userguide/index.html#_list_of_variables_for_a_process_instance

ilansch
Champ in-the-making
Champ in-the-making

***SOLVED***


Hi, The rest api command you wrote will not work when process has finished/Completed.
The command that does work and getting the process variables after process has finished and history is working:
http://localhost:1248/activiti-rest/service/history/historic-process-instances/?includeProcessVariab...

Thanks alot for trying to help !!