Questioned equal to character (≟) not valid in expression

I want to create a child If node with my URCap, with the condition: test≟"test". Is this possible?

I obtained the ≟ Unicode character in this way:

Ctrl + Shift + U -> 225f -> Space

This is the Java code to create the If node:

manager = apiProvider.getProgramAPI().getUndoRedoManager();	
contribution = apiProvider.getProgramAPI().getInstallationNode(PatternSelectorInstallationNodeContribution.class);
programNodeFactory = apiProvider.getProgramAPI().getProgramModel().getProgramNodeFactory();
	
ProgramAPI programAPI = apiProvider.getProgramAPI();
ProgramModel programModel = programAPI.getProgramModel();
rootTreeNode = programModel.getRootTreeNode(this);
lockTreeNodes();
	
IfNode ifNode = programNodeFactory.createIfNode();
	
try {
	ExpressionBuilder builder = apiProvider.getProgramAPI().getValueFactoryProvider().createExpressionBuilder();
	Expression expression;
	try {
		expression = builder.append("test").append("≟").append("\"test\"").build(); 
		ifNode = ifNode.setExpression(expression);
	} catch (InvalidExpressionException e) {
		e.printStackTrace();
	}
	ifTreeNode = rootTreeNode.addChild(ifNode);
} catch (TreeStructureException e1) {
	e1.printStackTrace();
}

The condition in the If node is empty, while if I write < instead of I see the correct condition If test<“test”.

This is the first part of the error in the console:

com.ur.urcap.api.domain.value.expression.InvalidExpressionException: Lexer exception on line 1: var_1 = test≟"test"
at com.ur.urcap.domain.expression.ExpressionParser.checkValidity(ExpressionParser.java:34)
at com.ur.urcap.domain.expression.ExpressionParser.parseExpression(ExpressionParser.java:23)
at com.ur.urcap.domain.expression.ExpressionBuilderImpl.build_aroundBody20(ExpressionBuilderImpl.java:83)
at com.ur.urcap.domain.expression.ExpressionBuilderImpl$AjcClosure21.run(ExpressionBuilderImpl.java:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at com.ur.polyscope.valueobjects.aspects.UncaughtExceptionAspect.aroundMethod(UncaughtExceptionAspect.java:24)
at com.ur.urcap.domain.expression.ExpressionBuilderImpl.build(ExpressionBuilderImpl.java:82)

I also cannot build the expression “≟” in if-node.
So I use the expression “==” as an alternative.

1 Like

In script code ‘==‘ is the logical expression for equivalency.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.