protected override void Execute(CodeActivityContext executionContext) { ITracingService tracingService = executionContext.GetExtension <ITracingService>(); IWorkflowContext context = executionContext.GetExtension <IWorkflowContext>(); IOrganizationServiceFactory serviceFactory = executionContext.GetExtension <IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); string htmlInput = HtmlInput.Get <string>(executionContext); tracingService.Trace("String supplied = " + htmlInput, htmlInput); string textOutput = string.Empty; //string pattern = "(<div.*>)(.*)(<\\/div>)"; //tracingService.Trace("Applying the following regex pattern: "+ pattern, pattern); //MatchCollection matches = Regex.Matches(htmlInput, pattern); //if (matches.Count > 0) //{ // foreach (Match m in matches) // { // StringOutput.Set(executionContext, HtmlToPlainText(m.Value)); // tracingService.Trace("The results returned are: "+m.Value , m.Value); // } //} StringOutput.Set(executionContext, HtmlToPlainText(htmlInput)); }
private void SetOutputValues(ActivityContext context, double value) { StringOutput.Set(context, String.Format("{0:0.0#####}", value)); MoneyOutput.Set(context, new Money { Value = Convert.ToDecimal(Math.Round(value, 2)) }); TruncatedOutput.Set(context, Convert.ToInt32(Math.Truncate(value))); RoundedOutput.Set(context, Math.Round(value, 0)); FloatOutput.Set(context, value); }