3
0
Fork 0

[svn r298] pinrted steps in xml mapping

This commit is contained in:
willemc 2007-11-26 17:33:41 +01:00
parent 32a23704bd
commit 33ea222ae1

View file

@ -29,6 +29,8 @@ package com.idcanet.foei.core.impl;
import com.idcanet.foei.core.ObjectBindingsManager; import com.idcanet.foei.core.ObjectBindingsManager;
import com.idcanet.foei.event.EventPort; import com.idcanet.foei.event.EventPort;
import com.idcanet.foei.event.EventPortType; import com.idcanet.foei.event.EventPortType;
import com.idcanet.foei.event.EventStep;
import com.idcanet.foei.event.EventStepController;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -42,8 +44,7 @@ import java.util.logging.Logger;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 20/04/2005 * @version 1.0 20/04/2005
*/ */
public class ObjectBindingsManagerImpl implements ObjectBindingsManager public class ObjectBindingsManagerImpl implements ObjectBindingsManager {
{
/** */ /** */
private Map<EventPort,List<EventPort>> bindingsOutput = null; private Map<EventPort,List<EventPort>> bindingsOutput = null;
/** Works like: eventPort(input) -> List (EventPorts(output) */ /** Works like: eventPort(input) -> List (EventPorts(output) */
@ -165,12 +166,24 @@ public class ObjectBindingsManagerImpl implements ObjectBindingsManager
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
result.append("<?xml version=\"1.0\"?>\n"); result.append("<?xml version=\"1.0\"?>\n");
result.append("<bindings>\n"); result.append("<bindings>\n");
//FoeiProcess process = FoeiProcessFactory.getFoeiProcess();
// todo: ID nameing should go automatic, and be reverse lookup'ale
for(EventPort port:bindingsOutput.keySet()) { for(EventPort port:bindingsOutput.keySet()) {
for(EventPort b:getBindings(port)) { for(EventPort b:getBindings(port)) {
result.append("<binding outputId=\""+port.getEventObject()+"\" outputPortName=\""+port.getName()); result.append("\t<binding outputClass=\""+port.getEventObject()+"\" outputPortName=\""+port.getName());
result.append("\" inputId=\""+b.getEventObject()+"\" inputPortName=\""+b.getName()+"\" inputPortPassed=\""+b.getEventsPassed()); result.append("\" inputClass=\""+b.getEventObject()+"\" inputPortName=\""+b.getName()+"\" inputPortPassed=\""+b.getEventsPassed());
result.append("\"/>\n"); Object o = port.getEventObject();
if (o instanceof EventStepController) {
result.append("\">\n");
EventStepController e = (EventStepController)o;
for(EventStep es:e.getEventSteps()) {
result.append("\t\t<step stepClass=\""+es+"\"/>\n");
}
result.append("\t</binding>\n");
} else {
result.append("\"/>\n");
}
} }
} }
result.append("</bindings>"); result.append("</bindings>");