How to create a PropertyMacro via Open API?
Hi all,
I am trying to create a PropertyMacro via Open API in a TF, but it doesn't seem to work though....
Actually this should like the following images:
But in reality it gives me this:
Any thoughts on how to fix this?
Cheers,
Dennis
I am trying to create a PropertyMacro via Open API in a TF, but it doesn't seem to work though....
⋮
// xml tag stuff
⋮
// dummy string for the internal content of the macro
node<StringLiteral> dummyString = new node<StringLiteral>();
dummyString.value.set("234");
// actual expression
node<ExpressionStatement> exprState = new node<ExpressionStatement>();
// exprState.expression.set(stcMCall);
exprState.expression.set(dummyString);
// statement list
node<StatementList> stateList = new node<StatementList>();
stateList.statement.add(exprState);
// property gpv macro
node<PropertyMacro_GetPropertyValue> macroGPV = new node<PropertyMacro_GetPropertyValue>();
macroGPV.body.set(stateList);
// actual property macro
node<PropertyMacro> realPropertyMacro = new node<PropertyMacro>();
realPropertyMacro.propertyValueFunction.set(macroGPV);
// add to xml attr text value
typeAttrValue.smodelAttribute.add(realPropertyMacro);
Actually this should like the following images:
But in reality it gives me this:
Any thoughts on how to fix this?
Cheers,
Dennis
3 comments
Sort by
Date
Votes
It is not clear at the first glance. I expect "typeAttrValue" is of concept XmlTextValue, isn't it?
Try using different instruction for adding property macro:
Thx Alex, it works like a charm now!
Please sign in to leave a comment.




