| Version 12 (modified by fbatard, 5 years ago) |
|---|
Code and Code again :)
How to simplify that?
private TLTNode FillNode(ElseType myElse) {
TLTNode node=new TLTNode();
for(ExecType exec : myElse.getExecArray()){
node.addExec(new TLTExec(exec.getId(),exec.getValue(),exec.getParam()));
}
for(IfType iflist : myElse.getIfArray()){
node.addIf(fillIfs(iflist));
}
return node;
}
private TLTNode FillNode(ThenType myThen) {
TLTNode node=new TLTNode();
for(ExecType exec : myThen.getExecArray()){
node.addExec(new TLTExec(exec.getId(),exec.getValue(),exec.getParam()));
}
for(IfType iflist : myThen.getIfArray()){
node.addIf(fillIfs(iflist));
}
return node;
}
The difference is only in the parameter.. Parameters are auto-generated types created by XMLBeans so we can't change it...
I'm coding the relation between the if value attributes and the conds nodes.
As we build the tree we have insert the cond in it and therefore we'll have to find the cond node by ourselves.
We won't need the # in the if statement anymore. Here is the new XML sample for the tasklist.
The Task tree is implemented , filled and tested. Everything works fine by now.
We had to change the schema once more to take into account the fact that an exec tag concerns another task OR an observer.
Then we added a type attribute to resolve it. Possible values are -> subtask OR observer
You can find the new schema here.
<exec id="so_known_whatever3" value="css-validator" type="subtask" />
Currently doing the tasklist.Task coupled with the UnmarshallerBeans?.Right now the Unmarshaller fills the MapOfObservation? of the tasklist.Task by parsing the generated JAXB Task.
Now , what we've done is to create the all tree of execution level in the constructor of the tasklist.Task. Then to list the observation we just have to browse the tree.
Is that too much responsability for the tasklist.Task object? Should we continue to do it in the unmarshaller?
The tasklist.Observation represent an observation with the different mimetype handling priority.
With our solution , an observation is almost like an exec tag in the new tasklist.
Then the tasklist.Observation will become much much simpler.
However we may create new classes to deal with the execution level to deal with the different Observation.
Any ideas on that?
Attachments
-
new-tasklist.xml
(1.7 KB) - added by fbatard
5 years ago.
new tasklist sample
-
tasklist-schema.2.xsd
(6.8 KB) - added by fbatard
5 years ago.
new Schema
