//private OptionSetValueCollection GetAttributeValues(CodeActivityContext executionContext, ITracingService tracingService) private OptionSetValueCollection GetNewAttributeValues(CodeActivityContext executionContext, ITracingService tracingService) { string attributeValues = AttributeValues.Get <string>(executionContext) ?? throw new ArgumentNullException("Attribute Values is empty"); tracingService.Trace("Attribute Values:'{0}'", attributeValues); if (string.IsNullOrEmpty(attributeValues)) { tracingService.Trace("No values found. Setting attribute to null"); return(new OptionSetValueCollection()); } string[] values = attributeValues.Split(','); if (values == null || values.Length == 0) { tracingService.Trace("No values found in array. Setting attribute to null"); return(new OptionSetValueCollection()); } OptionSetValueCollection optionSetValueCollection = new OptionSetValueCollection(); int intValue; foreach (string value in values) { if (int.TryParse(value, out intValue)) { tracingService.Trace("Value '{0}' added correctly", value); optionSetValueCollection.Add(new OptionSetValue(intValue)); } else { tracingService.Trace("Value '{0}' couldn't be parsed", value); } } return(optionSetValueCollection); }