Skip to content

Commit

Permalink
WFCORE-6347 Resolve capability reference against default value of att…
Browse files Browse the repository at this point in the history
…ribute, if necessary.
  • Loading branch information
pferraro committed Jan 9, 2024
1 parent 15bf03e commit 0454d1e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.capability.RuntimeCapability;
Expand Down Expand Up @@ -252,7 +253,11 @@ private static BiFunction<OperationContext, String, String> createRequirementNam
@Override
public String apply(OperationContext context, String value) {
ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS, false).getModel();
return model.get(attribute.getName()).asString();
try {
return attribute.resolveModelAttribute(context, model).asString();
} catch (OperationFailedException e) {
throw new IllegalArgumentException(e);
}
}
};
}
Expand Down

0 comments on commit 0454d1e

Please sign in to comment.