cancel
Showing results for 
Search instead for 
Did you mean: 

Can Activiti-cdi map dynamic data components to process variables without having a managed bean

chimu
Champ in-the-making
Champ in-the-making

We have a workflow UI in which data elements can be added dynamicaly, for eg user can give different ranges for a threshold
lets say ,  Target < 100 is good, Target > 150 is bad , target >= 300 is very bad. User has the choice to either give only 1 range
or he can also give upto 10 ranges. User is shown a Add button to add a range and that gives him a data panel dynamically to add it.
In that data panel he selects the Operator (<, >, <=, >=,=) and then he enters a value, and then he selects the range type(good, bad, excellent etc) from drop down. Can we model this screen with Activiti-Cdi such that the screen elements are directly set as process variables using  @BusinessProcessScoped bean without the need of intermediate Managed bean. In that case how will these dynamic ranges get mapped to the bean. We want these ranges to get set as a ArrayList of beans, and the arrayList itself is a field of the BusinessProcessScoped bean. Also before starting the BPM process we need to validate these data element and throw messages to the user in case he inputs some overlapping ranges. Will this be possible without using a regular Managed bean ??
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
You can have the ArrayList as a field of the Serializable @BusinessProcessScoped, this will also be stored in the activiti database (serialized), so you can access the array list in e.g.. expressions or JavaDelegates in the process and perform validation.

chimu
Champ in-the-making
Champ in-the-making
You didn't get my question correct, we are looking for JSF validations and we will start the BPM process only after we have passed the validations stage, so we haven't reached the JavaDelegate/Expressions yet.  Another point which still remains unanswered is how we map these dynamic data panels to Beans inside the Arraylist.  We were using the following syntax to map static text box to process variables
  p:inputText value="#{processVariables['noOfDays']}"
, but now we have a complex screen to map with dynamic text boxes.

frederikherema1
Star Contributor
Star Contributor
I guess you'll have to bind your UI to an intermediate model and, after validation and binding, flush that to activiti… I'm not a JSF-binding expert so I that's the best I can do Smiley Wink