cancel
Showing results for 
Search instead for 
Did you mean: 

REST Call Task and People form variables in the request

srojas1
Champ in-the-making
Champ in-the-making
Hi

In my business scenario I have a User Task which has a form associated. This form contains a people selector field. Up to this point everything correct.
After the User Task, I have a REST Call Task in whose Request I want to map the value of the the people form field of the previous User Task. With this value I will set in Alfresco variables for a folder. Here is when the problem comes, people type variables are not available in the Request mapping of the REST Call Tasks.

Anyone that has faced a similar problem and know how to do it or a potential workaround?

Thanks in advance and regards

Sergio
6 REPLIES 6

srojas1
Champ in-the-making
Champ in-the-making
Hi.

I have realised that nobody answer the question. Is it because I did not explain myself properly of because there is not answer to the question?

Regards

Sergio

vasile_dirla
Star Contributor
Star Contributor
Hi,
Currently we support this set of field types:
<code>
   restRequestMappingFieldTypes = ['text', 'integer', 'date', 'boolean', 'dropdown', 'radio-buttons', 'typeahead', 'amount'];
</code>

I guess you need the selected userId to be sent with the REST call, right?
if so, you could use another variable for example: selectedUser of long type and this variable will store the id of the selected person.
and then you could use this variable inside your REST task. (just did a process in this way and i was able to call: http://google.com/user=2)

srojas1
Champ in-the-making
Champ in-the-making
Hi Vasile. Thanks for your reply.

I am new on this. I am using the the Activiti web app editor. Regarding your solution I have some questions:

1 - How can automatically set the id of the selected person in another variable once the person is selected?
2 - What I need is to pass the User name via REST so I can display it in my target app. If I only have a long number, how can I access the real user name from that long number?

Regards

Sergio

trademak
Star Contributor
Star Contributor
Hi Sergio,

This is currently not supported. You could use a script or service task to set the id and name of the user in variables that you can use in your REST call. When using a Spring bean for a service task you would be able to access all Activiti Spring beans including UserService to retrieve user information for a specific user id.

Best regards,

srojas1
Champ in-the-making
Champ in-the-making
Thanks trademak, very useful. Step by step I am getting to learn the APIs.

I have found Java API documentation, but not javascript api documentation. Do you know where can I find it.

Thanks and Regards

Sergio

jbarrez
Star Contributor
Star Contributor
There is not really a 'javascript api': basically we expose some variables like 'execution', 'task' when writing scripts but that's it.