cancel
Showing results for 
Search instead for 
Did you mean: 

How to set assignee of next step from a form field

rollando
Champ on-the-rise
Champ on-the-rise

Hello,

I've created a form that contains a field of type "People" that enables users to pick another user. Now I'd like to set the picked user as the assignee of the next step, how can I do that ?

I'm using Activiti 6.0

I've run into other threads that mention XML parts of code, but I'm not sure where I should input that.

1 ACCEPTED ANSWER

bassam_al-saror
Star Collaborator
Star Collaborator

There seems to be a issue with the people field (submitted value is null). However you can use a text field to enter the assignee id that can be used as the assignee of the next task. I've attached an example app here.

View answer in original post

8 REPLIES 8

bassam_al-saror
Star Collaborator
Star Collaborator

There seems to be a issue with the people field (submitted value is null). However you can use a text field to enter the assignee id that can be used as the assignee of the next task. I've attached an example app here.

I've come to the same conclusion. I've then replaced it by a drop down and set the variable in the assignee field, and it works just fine Smiley Happy

Another thing that doesn't seem to work is the file upload field, it's possible to upload a file, but not to display it in the following forms. Any idea about how to retrieve the url of the file or to let next users access it ?

Displaying uploaded file isn't something that was implemented in community version.

Thanks for the tip !

I know it's not related to the original topic, but I have a few questions about Acitiviti, do you mind if I ask them here?

  • I was wondering if it's possible in Activiti to build custom views of tasks with custom filters ? Some sort of tables with columns I would pick from the available fields.
  • Are there scheduled tasks in Activiti ? I would like to build a task reminder that would notify users on a periodic basis if a task is not completed. If there's no such built-in feature, I thought I could easily implement the API and make my own task reminder.
  • Is it possible to edit the templates of the app ? I would like to create a new field named "title", initialize it with values from the form and display it in the process view.
  • Are there documentation for all those things (API, Custom code, etc)

Thank you for your help

Each one of the above requires a separate topic  I'll try to reply here

1) You can use the native query API Activiti User Guide to execute custom queries or write custom mappers if you want Activiti User Guide.

2) You can attach a boundary event Activiti User Guide  to a user task that can execute a mail task for example to send a reminder.

3) You'll have to write custom code for that.

I hope these answer your questions.

rollando
Champ on-the-rise
Champ on-the-rise

thanks, that answers my questions.

Regarding API, there seems to be a bug or something undocumented.

I create an instance using the function POST /activiti-rest/service/runtime/process-instances

an instance is created and its process-instance-id is returned.

Now, I want to complete the first step of the freshly created instance.

I've found : POST /activiti-rest/service/runtime/tasks/task-id (+ action name in the body) should do the job

and it indeed works fine, provided I know the task-id of the task to complete, however the task-id is not returned when the instance is created,and is nowhere to be found.

I've tried GET /activiti-rest/service/runtime/process-instances/process-instance-id which only contains process related stuff and GET /activiti-rest/service/runtime/process-instances/process-instance-id/tasks which I expected to return the list of tasks but returned 404.

How should I proceed ? Is there maybe a trick to create an instance and complete the task at the same time ?

To get tasks you need to use the Tasks Rest endpoints. See https://www.activiti.org/userguide/#_tasks you can filter the results by processInstnaceId.

Please open a new topic if you want to discuss something unrelated to the original post.

Sure will !

Just for the record, your solution works; however, it doesn't look like a very elegant way to accomplish it, even though it's the only way.

thanks