Variable contextVariable = Variables.getVariable(graph, parameter);
Variable configVariable = Variables.getVariable(graph, parameter2);
Variable activeVariable = Variables.switchPossibleContext(graph, configVariable, contextVariable.getRepresents(graph));
+ if(activeVariable == null) return Variant.ofInstance("Could not resolve " + configVariable.getURI(graph) + " for " + contextVariable.getURI(graph));
return activeVariable.getVariantValue(graph);
}
}, new Listener<Variant>() {
@Override
public void exception(Throwable t) {
- LOGGER.error("Error while evaluating variable value", t);
+ LOGGER.error("Error while evaluating variable value, context = " + context + " uri=" + uri, t);
}
@Override
import org.simantics.spreadsheet.solver.SpreadsheetCellContentExpression;
import org.simantics.spreadsheet.solver.SpreadsheetCellEditable;
import org.simantics.spreadsheet.solver.SpreadsheetFormula;
+import org.simantics.spreadsheet.solver.SpreadsheetSCLConstant;
import org.simantics.spreadsheet.solver.SpreadsheetTypeNode;
import org.simantics.structural.stubs.StructuralResource2;
public SpreadsheetNodeManager(SpreadsheetRealm realm) {
super(realm, realm.getEngine());
+ new Exception().printStackTrace();
realm.getEngine().registerListener(new SpreadsheetBookListener() {
@Override
@Override
public void run() {
for(SpreadsheetCell cell : cells) {
- System.err.println("Modification in cell " + cell);
+ System.err.println("Modification in cell " + cell.getName());
refreshVariable(new SpreadsheetCellContent(cell));
- refreshVariable(new SpreadsheetCellContentExpression(cell));
+ Object content = cell.getContent();
+ if(content instanceof SpreadsheetFormula || content instanceof SpreadsheetSCLConstant)
+ refreshVariable(new SpreadsheetCellContentExpression(cell));
}
}
});