cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti REST Api Complect Variables not shown

krull80
Champ in-the-making
Champ in-the-making
Hello All,

First of all, thanks for your product and the work done (I really like the REST approach). I have been working in your product in the last couple of days as I need to prepare a PoC. One of the tests I'm doing is the integration of mule-activiti, in this test I'm starting a process instance where I pass form properties + variables. Form properties are stored and I can see them in Activiti-explorer, but when I pass complex process variables they are not stored in the table act_ru_variable. I can see the column type=null and no value in text2 or text1

you can try this sample (sample deployment included in activiti):

{
   "processDefinitionKey":"createTimersProcess",
   "businessKey":"order-012",
   "duration":"long",
   "throwException":"true",
   "variables":[
      {
         "name":"myVar",
         "value":"This is a variable",
        "type":"string"
      }
   ]
}

Did I make a mistake sending the request? Do I need to check a different table?

Thanks in advance
6 REPLIES 6

trademak
Star Contributor
Star Contributor
Could it be that the process is completed rightaway? Then you should be able to find the variable in the history table.

Best regards,

krull80
Champ in-the-making
Champ in-the-making
Hi,

Thanks for the advice, but unfortunately the process is still active and in the variables table, the process is storing a null value in the column type. 

I'm using MySQL and Activiti is deployed in a Weblogic server, Is there anything I'm missing?

Thanks & Regards,

frederikherema1
Star Contributor
Star Contributor
What URL are you actually using and what is the EXACT request body? (please use syntax for nice formatting Smiley Wink)
Don't think combining form-properties and plain variables works, use either approach (I whould suggest using plain-variables, has better type-support)

Hi Fredererik,

I have used the following url:

<code>http://<host>:<port>/activiti-rest/service/process-instance</code>

and the content (formatted 🙂 😞

<code>
{
   "processDefinitionKey":"createTimersProcess",
   "businessKey":"order-0012",
   "duration":"long",
   "throwException":"true",
   "variables": [
      {
         "name":"myVar",
         "value":"This is a variable",
        "type":"string"
      }
   ]
}
</code>

I know that the method is not using the 'dummy' variable, but I wanted to check the behavior at database level.

If it's not possible combining form+plain variables then I will go with the plain variables.
Is there any way you can define a 'contract' for that process (like a wsdl)  so the  user can understand the variables to be passed?

Thanks and regards

frederikherema1
Star Contributor
Star Contributor
There is no way to define this kind of "contract" out of the box, however, you can always come up with additional method (using form-key to do your custom mapping in your system, use a resource in the deployment, referenced by the form-key, …)

Hello Frederik,

Thanks for the response, I will try to follow your advice.