How to set some required variables to start a process (besides the form)?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2014 05:24 PM
Hi everyone,
I was able to set required Activiti form variables on a process start event and this works great on the explorer. Human user has to enter the value of the variables on the form or they cannot start the task.
However, through the REST API, one can still simply start a process without providing these variables. Is it possible to make variables mandatory using the process definition? Or do I have to write my own REST service and validate the variables?
Thank you very much!
–Gordon
I was able to set required Activiti form variables on a process start event and this works great on the explorer. Human user has to enter the value of the variables on the form or they cannot start the task.
However, through the REST API, one can still simply start a process without providing these variables. Is it possible to make variables mandatory using the process definition? Or do I have to write my own REST service and validate the variables?
Thank you very much!
–Gordon
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2014 09:07 PM
I'm thinking about a workaround which is have the very first task to be a script task and check the required variables and throw error/exceptions.
I wonder if there can be something easier built in.
I wonder if there can be something easier built in.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2014 04:12 AM
When you use the form REST API you get exactly the same functionality as the Java API:
http://activiti.org/userguide/index.html#N15B82
Best regards,
http://activiti.org/userguide/index.html#N15B82
Best regards,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2014 02:27 PM
Thank you trademak for the reply and the link. But it is not my question. I am looking for real validation to prevent a process instance from starting if required variables are not provided.
The form variables on the start event works if user uses the explorer but not when code using the REST API.
I hope this can be a feature on the REST API and fundamentally on the engine.
Thank you.
The form variables on the start event works if user uses the explorer but not when code using the REST API.
I hope this can be a feature on the REST API and fundamentally on the engine.
Thank you.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2014 01:37 AM
Hi,
You could add this functionality to org.activiti.engine.impl.bpmn.behavior.NoneStartEventActivityBehavior or to the listeners.
Regards
Martin
You could add this functionality to org.activiti.engine.impl.bpmn.behavior.NoneStartEventActivityBehavior or to the listeners.
Regards
Martin
