01-13-2011 11:31 AM
<input type="text" value="${m.title}">
Let's make an assumption that I edit this field and change it's value (from "title1" to "title2". Then in the next (next UserTask) step I display the value once again using the following piece of code:
<td>${m.title}</td>
and I expect that the value will be changed to this entered in previous step, but the value is the same. How can I handle this?
01-14-2011 03:52 AM
01-14-2011 04:29 AM
01-14-2011 04:49 AM
01-14-2011 06:15 AM
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
targetNamespace="http://www.bpmnwithactiviti.org/movieOrder">
<process id="movieOrder" name="Order a movie">
<startEvent id="start" />
<sequenceFlow sourceRef="start" targetRef="parseJson" />
<serviceTask id="parseJson" name="Parse JSON" activiti:class="services.ParseJSONService" />
<sequenceFlow sourceRef="parseJson" targetRef="assignTechnician" />
<userTask id="assignTechnician" name="Assign the technician" activiti:candidateGroups="customers" activiti:formKey="assignTechnician.form" />
<sequenceFlow sourceRef="assignTechnician" targetRef="createMovie" />
<userTask id="createMovie" name="Create movie" activiti:formKey="createMovie.form"/>
<sequenceFlow sourceRef="createMovie" targetRef="end" />
<endEvent id="end" />
</process>
</definitions>
In ParseJSONService I parse the incoming request and store m variable in the context.
public class ParseJSONService implements JavaDelegate {
private GsonMapper gm = new GsonMapper();
@Override
public void execute(DelegateExecution de) throws Exception {
String mJson = (String) de.getVariable("movie");
Movie m = gm.fromJson(mJson, Movie.class);
de.setVariable("m", m);
}
}
Movie:
public class Movie implements Serializable {
private Integer id;
private String title;
private String genre;
private String spiCode;
//public getters and setters
}
In assignTechnician.form I can edit some movie properties (the movie's properties are displaying well):
<div>
<h1>Order</h1>
<table>
<tr>
<td>Title</td>
<td><input type="text" value="${m.title}"></td>
<td>Genre</td>
<td><input type="text" value="${m.genre}"></td>
<td>SPI</td>
<td><input type="text" value="${m.spiCode}"></td>
</tr>
</table>
</div>
I expect that on the createMovie.form I will see updated values of movie (changed in assignedTechnician.form) but this doesn't happen. createMovie.form:
<div>
<h1>Order</h1>
<table>
<tr>
<td>Title</td>
<td>${m.title}</td>
<td>Genre</td>
<td>${m.genre}</td>
<td>SPI</td>
<td>${m.spiCode}</td>
</tr>
</table>
</div>
My question is: what should be done to see the updated properties o m object on the following forms in my process.
01-17-2011 02:40 AM
01-17-2011 03:13 AM
<td><input type="text" value="${m.title}"></td>
<input type="text" name="employeeName" value="" />
<activiti:formProperty id="title" expression="#{m.title}" required="true" />
01-17-2011 04:39 AM
Currently the REST-API (and explorer) doesn't use the formProperties yet.
01-17-2011 04:45 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.