Source:
<code>public List<String> resolveVirtualAttributeValueChange(PerunSessionImpl sess, String message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<String> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; Matcher addUserExtSourceMatcher = addUserExtSource.matcher(message); Matcher removeUserExtSourceMatcher = removeUserExtSource.matcher(message); Matcher extSourceRemsMatcher = extSourceRems.matcher(message); Matcher affiliationsAttributeMatcher = affiliationsAttribute.matcher(message); User user; Attribute attrVirtRemsLogins; if (affiliationsAttributeMatcher.find() || ( extSourceRemsMatcher.find() && (addUserExtSourceMatcher.find() || removeUserExtSourceMatcher.find()))) { user = (new ModulesUtilsBlImpl()).getUserFromMessage(sess, message); if (user != null) { attrVirtRemsLogins = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_VIRT + ":elixirBonaFideStatus"); <START> String messageAttributeSet = attrVirtRemsLogins.serializeToString() + " set for " + user.serializeToString() + "."; <END> resolvingMessages.add(messageAttributeSet); } } return resolvingMessages; }</code><technical_language>I prefer care situations: 1] of attribut is null - set, 2] of attribute is null - remove. in schacHomeOrganizations user virt attribute module</technical_language>

Target:
public List<String> resolveVirtualAttributeValueChange(PerunSessionImpl sess, String message) throws InternalErrorException, WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException { List<String> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; Matcher userSetMatcher = userSetPattern.matcher(message); Matcher userRemoveMatcher = userRemovePattern.matcher(message); Matcher userAllAttrsRemovedMatcher = userAllAttrsRemovedPattern.matcher(message); Matcher uesAllAttrsRemovedMatcher = uesAllAttrsRemovedPattern.matcher(message); Matcher uesSetAffiliationAttributeMatcher = uesSetAffiliationAttributePattern.matcher(message); Matcher uesRemoveAffiliationAttributeMatcher = uesRemoveAffiliationAttributePattern.matcher(message); User user; Attribute attribute; if (uesSetAffiliationAttributeMatcher.find() || uesRemoveAffiliationAttributeMatcher.find() || uesAllAttrsRemovedMatcher.find() || userSetMatcher.find() || userRemoveMatcher.find() || userAllAttrsRemovedMatcher.find()) { user = sess.getPerunBl().getModulesUtilsBl().getUserFromMessage(sess, message); if (user != null) { String messageAttributeSet; attribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_VIRT + ":" + FRIENDLY_NAME); String value = (String) attribute.getValue(); if (value == null || value.isEmpty()) { AttributeDefinition attributeDefinition = new AttributeDefinition(attribute); messageAttributeSet = attributeDefinition.serializeToString() + " removed for " + user.serializeToString() + "."; } else { messageAttributeSet = attribute.serializeToString() + " set for " + user.serializeToString() + "."; } resolvingMessages.add(messageAttributeSet); } else { log.error("Failed to get user from message: {}", message); } } return resolvingMessages; }