Need to access processVariables in convertFormValueToModelValue()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2014 10:31 AM
Hi,
I have been searching the forum now very deeply, but I couldn't find any topic that fits for my problem:
I write my own custom FormType (extends AbstractFormType). I wanted to do it analog to the more complex "ProcessDefinitionFormType" example explained in http://www.jorambarrez.be/blog/2013/03/13/creating-a-new-form-property-in-activiti/
The difference to the example above is, that my Modelobjects are stored in a List-Attribute of a Bean class, which itself is a processVariable. I retrieve that Bean in a taskListener when a new processinstance starts and put it also into the processVariables from there.
My problem now is, that the convertFormValueToModelValue()-Method does not know, which ProcessInstance is currently involved. It only knows the "propertyValue"- argument. Is there a way to get the missing link?
The same problem exists for my implementation of the AbstractFormPropertyRenderer. In order to populate the ComboBox, I must iterate over the list in the Bean.
Many thanks in advance,
Stephan
I have been searching the forum now very deeply, but I couldn't find any topic that fits for my problem:
I write my own custom FormType (extends AbstractFormType). I wanted to do it analog to the more complex "ProcessDefinitionFormType" example explained in http://www.jorambarrez.be/blog/2013/03/13/creating-a-new-form-property-in-activiti/
The difference to the example above is, that my Modelobjects are stored in a List-Attribute of a Bean class, which itself is a processVariable. I retrieve that Bean in a taskListener when a new processinstance starts and put it also into the processVariables from there.
My problem now is, that the convertFormValueToModelValue()-Method does not know, which ProcessInstance is currently involved. It only knows the "propertyValue"- argument. Is there a way to get the missing link?
The same problem exists for my implementation of the AbstractFormPropertyRenderer. In order to populate the ComboBox, I must iterate over the list in the Bean.
Many thanks in advance,
Stephan
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2014 07:31 AM
I'm not sure, but can you get the current ExecutionContext (Context.getExecutionContext():smileywink:, that would give you the current execution and thus the process instance.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2014 03:28 AM
Hi Joram,
thanks, but I could neither find a class named "Context" nor "ExecutionContext". In which jar file are they included?
thanks again,
Stephan
thanks, but I could neither find a class named "Context" nor "ExecutionContext". In which jar file are they included?
thanks again,
Stephan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2014 05:36 AM
ups, I only looked into the api-docs. I found the classes in the impl packages. sorry for stealing your time. Finally I must decide for myself, if I want to use an impl class directly in my source code (I mean from a "design-technical" point of view).
Thanks,
Stephan
Thanks,
Stephan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2014 05:45 AM
sorry, I need to follow up once more. If I used activiti-cdi, would it then be possible to inject activiti-stuff into my custom form type? If yes, which scope suits best for that case? => This maybe turns out to become a more general question: Which Scope suits best for the other stuff I extend, like TaskListeners, especially when i am inside the activiti-explorer.war (to be more precise: we are trying to use activiti-stuff only inside the explorer webapp and plan to make REST-calls into a completely separate EAR file (which itself is unaware of activiti) for the "real" business logic stuff).
Thanks again,
Stephan
Thanks again,
Stephan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2014 04:10 AM
> Finally I must decide for myself, if I want to use an impl class directly in my source code
Valid point. Those impl classes are indeed not seen as 'stable' vs the API.
> If I used activiti-cdi, would it then be possible to inject activiti-stuff into my custom form type
Im not sure about CDI (not my main knowledge) - but if the form stuff is in a bean that should work. However, I don't know how this setup would look as the order if injecting will probably have influence.
Valid point. Those impl classes are indeed not seen as 'stable' vs the API.
> If I used activiti-cdi, would it then be possible to inject activiti-stuff into my custom form type
Im not sure about CDI (not my main knowledge) - but if the form stuff is in a bean that should work. However, I don't know how this setup would look as the order if injecting will probably have influence.
