/// <summary> /// Sets the HpcrActivityData runtime information. /// </summary> private void SetRuntimeData() { // Massage originator email with runtime information (if necessary) _runtimeOriginator = ReplaceCurrentUser(_runtimeOriginator); // Massage recipient with runtime information (if necessary) if (_runtimeRecipients.Any(x => x.Equals(Constants.RANDOM_DISTRIBUTION))) { var distributionNames = ProxyClient.GetDistributions(_pluginExecutionData.Servers.First().Address, _runtimeOriginator).Select(x => x.Title); var revisedRecipients = new Collection <string>(); foreach (var recipient in _runtimeRecipients) { revisedRecipients.Add(ReplaceRandomDistribution(recipient, distributionNames)); } _runtimeRecipients = revisedRecipients; } UpdateStatus("Fetching documents..."); //Cap at 2 documents max (chosen at random if more than 2 exist). if (_pluginExecutionData.Documents.Count > 2) { DocumentCollectionIterator iterator = new DocumentCollectionIterator(CollectionSelectorMode.ShuffledRoundRobin); string path1 = ExecutionServices.FileRepository.AsInternal().GetDocumentSharePath(iterator.GetNext(_pluginExecutionData.Documents)); string path2 = ExecutionServices.FileRepository.AsInternal().GetDocumentSharePath(iterator.GetNext(_pluginExecutionData.Documents)); _runtimeDocumentPaths.Add(path1); _runtimeDocumentPaths.Add(path2); } else { string path = ExecutionServices.FileRepository.AsInternal().GetDocumentSharePath(_pluginExecutionData.Documents.First()); _runtimeDocumentPaths = new Collection <string>(); _runtimeDocumentPaths.Add(path); } }