<commit_before>package modules.admin.Communication.actions;

import java.util.List;

import modules.ModulesUtil;
import modules.admin.Communication.CommunicationUtil;
import modules.admin.Tag.TagBizlet;
import modules.admin.domain.Communication;
import modules.admin.domain.Communication.ActionType;
import modules.admin.domain.Contact;

import org.skyve.domain.Bean;
import org.skyve.domain.messages.Message;
import org.skyve.domain.messages.ValidationException;
import org.skyve.metadata.controller.ServerSideAction;
import org.skyve.metadata.controller.ServerSideActionResult;
import org.skyve.web.WebContext;

public class TestSend implements ServerSideAction<Communication> {
	/**
	 * For Serialization
	 */
	private static final long serialVersionUID = 2886341074753936987L;

	/**
	 * Kick off the annual returns job.
	 */
	@Override
	public ServerSideActionResult execute(Communication communication, WebContext webContext) throws Exception {

		communication.setActionType(ActionType.sendImmediately);
		

		//set send to our own address
		Contact me = ModulesUtil.currentAdminUser().getContact();
		String[] myAddress = new String[] {me.getEmail1()};
		
		//Get First tagged item to test
		List<Bean> beans = TagBizlet.getTaggedItemsForDocument(communication.getTag(), communication.getModuleName(), communication.getDocumentName());
		
		if(beans.isEmpty()){
			throw new ValidationException(new Message("There are no tagged items - tag at least 1 (one) item to test this communication."));
		}
		
		CommunicationUtil.sendOverrideTo(communication, CommunicationUtil.RunMode.ACTION, CommunicationUtil.ResponseMode.EXPLICIT, myAddress, beans.get(0));
		
		return new ServerSideActionResult(communication);
	}
}
<commit_msg>Fixed TestSend for communication bean bindings<commit_after>package modules.admin.Communication.actions;

import java.util.List;

import modules.ModulesUtil;
import modules.admin.Communication.CommunicationUtil;
import modules.admin.Tag.TagBizlet;
import modules.admin.domain.Communication;
import modules.admin.domain.User;
import modules.admin.domain.Communication.ActionType;
import modules.admin.domain.Contact;

import org.skyve.domain.Bean;
import org.skyve.domain.messages.Message;
import org.skyve.domain.messages.ValidationException;
import org.skyve.metadata.controller.ServerSideAction;
import org.skyve.metadata.controller.ServerSideActionResult;
import org.skyve.web.WebContext;

public class TestSend implements ServerSideAction<Communication> {
	/**
	 * For Serialization
	 */
	private static final long serialVersionUID = 2886341074753936987L;

	/**
	 * Kick off the annual returns job.
	 */
	@Override
	public ServerSideActionResult execute(Communication communication, WebContext webContext) throws Exception {

		communication.setActionType(ActionType.sendImmediately);

		//set send to our own address
		Contact me = ModulesUtil.currentAdminUser().getContact();
		String[] myAddress = new String[] {me.getEmail1()};
		User user = ModulesUtil.currentAdminUser();
		
		//Get First tagged item to test
		List<Bean> beans = TagBizlet.getTaggedItemsForDocument(communication.getTag(), communication.getModuleName(), communication.getDocumentName());
		
		if(beans.isEmpty()){
			throw new ValidationException(new Message("There are no tagged items - tag at least 1 (one) item to test this communication."));
		}
		
		CommunicationUtil.sendOverrideTo(communication, CommunicationUtil.RunMode.ACTION, CommunicationUtil.ResponseMode.EXPLICIT, myAddress, beans.get(0),user, communication);
		
		return new ServerSideActionResult(communication);
	}
}

{'fraction_non_alphanumeric': 0.09660356347438753, 'fraction_numerical': 0.012249443207126948, 'mean_word_length': 5.830798479087452, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3021713', 'n_tokens_mistral': 1095, 'n_tokens_neox': 966, 'n_words': 229}