use of org.ballerinalang.model.values.BMessage in project carbon-apimgt by wso2.
the class SetProperty method execute.
@Override
public BValue[] execute(Context context) {
BMessage msg = (BMessage) getRefArgument(context, 0);
String propertyName = getStringArgument(context, 0);
BValue propertyValue = getRefArgument(context, 1);
if (propertyName != null && propertyValue != null) {
msg.setProperty(propertyName, propertyValue);
}
return VOID_RETURN;
}
use of org.ballerinalang.model.values.BMessage in project carbon-apimgt by wso2.
the class GetProperty method execute.
@Override
public BValue[] execute(Context context) {
BMessage msg = (BMessage) getRefArgument(context, 0);
String propertyName = getStringArgument(context, 0);
BValue propertyValue = (BValue) msg.getProperty(propertyName);
if (propertyValue == null) {
return VOID_RETURN;
}
return getBValues(propertyValue);
}