public static string step_pick1_somma(HttpContext context) { WorkflowDefinition workflowDefinition = new WorkflowDefinition() { Workflow = WorkflowDefinitions.workflow_pick1(), Correlation = new WorkflowCorrelation() { CorrelationId = Guid.Parse(context.Request.Form["correlationid"]) }, }; int numero = int.Parse(context.Request.Form["numero"]); var response = manager.ContinueWorkflow <int, bool>(workflowDefinition, numero, "Somma"); if (response) { StringBuilder sb = new StringBuilder(); sb.Append("<form action='/step' method='post'>"); sb.Append($"<input type='hidden' name='correlationid' value='{workflowDefinition.Correlation.CorrelationId}' />"); sb.Append("<input type='hidden' name='step' value='step_pick1_somma' />"); sb.Append("<input type='text' name='numero'/>"); sb.Append("<input type='submit' value='Somma'/>"); sb.Append("</form></br></br>"); sb.Append("<form action='/step' method='post'>"); sb.Append($"<input type='hidden' name='correlationid' value='{workflowDefinition.Correlation.CorrelationId}' />"); sb.Append("<input type='hidden' name='step' value='step_pick1_fine' />"); sb.Append("<input type='submit' value='Fine'/>"); sb.Append("</form></br></br>"); return(sb.ToString()); } return("Qualcosa è andato storto"); }
public static string sample_pick1(HttpContext context) { WorkflowDefinition workflowDefinition = new WorkflowDefinition() { //Correlation = new WorkflowCorrelation() { CorrelationId = Guid.Parse("7777b449-410c-49d9-b29b-b37419d0895a") /*Guid.NewGuid()*/ }, Correlation = new WorkflowCorrelation() { CorrelationId = Guid.NewGuid() }, Workflow = WorkflowDefinitions.workflow_pick1(), }; var response = manager.StartWorkflow <RequestBase, bool>(workflowDefinition, null, "Start"); if (response) { StringBuilder sb = new StringBuilder(); sb.Append("<form action='/step' method='post'>"); sb.Append($"<input type='hidden' name='correlationid' value='{workflowDefinition.Correlation.CorrelationId}' />"); sb.Append("<input type='hidden' name='step' value='step_pick1_somma' />"); sb.Append("<input type='text' name='numero'/>"); sb.Append("<input type='submit' value='submit'/>"); sb.Append("</form>"); return(sb.ToString()); } return("Qualcosa è andato storto"); }
public static string step_SFSystemCalculator_continue(HttpContext context) { WorkflowDefinition workflowDefinition = new WorkflowDefinition() { Workflow = WorkflowDefinitions.workflow_SFSystemCalculator(), Correlation = new WorkflowCorrelation() { CorrelationId = Guid.Parse(context.Request.Form["correlationid"]) }, }; int numero = 0; int.TryParse(context.Request.Form["number"], out numero); var request = new SFSystemCalculatorOpRequest() { Number = numero, Op = context.Request.Form["op"] }; var response = manager.ContinueWorkflow <SFSystemCalculatorOpRequest, SFSystemCalculatorOpResponse>(workflowDefinition, request, "continue"); StringBuilder sb = new StringBuilder(); if (response != null && response.Risultato.Esito && response.Executed) { sb.Append("<script>"); sb.Append("function setOpt(op){document.getElementById('op').value = op.value;}"); sb.Append("</script>"); sb.Append($"Workflow SFSystemCalculator calcolo eseguito</br></br>"); sb.Append("<form action='/step' method='post'>"); sb.Append($"<input type='hidden' name='correlationid' value='{workflowDefinition.Correlation.CorrelationId}' />"); sb.Append("<input type='hidden' name='step' value='step_SFSystemCalculator_continue' />"); sb.Append("<input type='hidden' name='op' id='op'/>"); sb.Append("<div>"); sb.Append("<div><input type='text' name='number' value='0'/></div>"); sb.Append("<div><input onclick='setOpt(this);' type='submit' value='+' style='width:30px;' /> <input onclick='setOpt(this);' type='submit' value='-' style='width:30px;'/></div>"); sb.Append("<div><input onclick='setOpt(this);' type='submit' value='*' style='width:30px;' /> <input onclick='setOpt(this);' type='submit' value=':' style='width:30px;'/></div>"); sb.Append("</div>"); sb.Append("</form>"); sb.Append("<form action='/step' method='post'>"); sb.Append($"<input type='hidden' name='correlationid' value='{workflowDefinition.Correlation.CorrelationId}' />"); sb.Append("<input type='hidden' name='step' value='step_SFSystemCalculator_end' />"); sb.Append("<input onclick='setOpt(this);' type='submit' value='Fine'/> "); sb.Append("</form>"); } else if (response != null && !response.Risultato.Esito) { sb.Append($"<p style='color:red'>{response.Risultato.Message}</p>"); } return(sb.ToString()); }
public static string step_pick1_fine(HttpContext context) { WorkflowDefinition workflowDefinition = new WorkflowDefinition() { Workflow = WorkflowDefinitions.workflow_pick1(), Correlation = new WorkflowCorrelation() { CorrelationId = Guid.Parse(context.Request.Form["correlationid"]) }, }; var response = manager.ContinueWorkflow <RequestBase, int>(workflowDefinition, null, "Fine"); StringBuilder sb = new StringBuilder(); sb.Append($"Totale: {response}</br></br>"); return(sb.ToString()); }
public static string sample_SFSystemCalculator(HttpContext context) { WorkflowDefinition workflowDefinition = new WorkflowDefinition() { Correlation = new WorkflowCorrelation() { CorrelationId = Guid.NewGuid() }, Workflow = WorkflowDefinitions.workflow_SFSystemCalculator(), }; var response = manager.StartWorkflow <SFSystemCalculatorStartRequest, SFSystemCalculatorStartResponse>(workflowDefinition, null, "Start"); StringBuilder sb = new StringBuilder(); if (response != null && response.Started) { sb.Append("<script>"); sb.Append("function setOpt(op){document.getElementById('op').value = op.value;}"); sb.Append("</script>"); sb.Append($"Workflow SFSystemCalculator partito</br></br>"); sb.Append("<form action='/step' method='post'>"); sb.Append($"<input type='hidden' name='correlationid' value='{workflowDefinition.Correlation.CorrelationId}' />"); sb.Append("<input type='hidden' name='step' value='step_SFSystemCalculator_continue' />"); sb.Append("<input type='hidden' name='op' id='op'/>"); sb.Append("<div>"); sb.Append("<div><input type='text' name='number' value='0'/></div>"); sb.Append("<div><input onclick='setOpt(this);' type='submit' value='+' style='width:30px;' /> <input onclick='setOpt(this);' type='submit' value='-' style='width:30px;'/></div>"); sb.Append("<div><input onclick='setOpt(this);' type='submit' value='*' style='width:30px;' /> <input onclick='setOpt(this);' type='submit' value=':' style='width:30px;'/></div>"); sb.Append("</div>"); sb.Append("</form>"); } return(sb.ToString()); }
public static string step_SFSystemCalculator_end(HttpContext context) { WorkflowDefinition workflowDefinition = new WorkflowDefinition() { Workflow = WorkflowDefinitions.workflow_SFSystemCalculator(), Correlation = new WorkflowCorrelation() { CorrelationId = Guid.Parse(context.Request.Form["correlationid"]) }, }; var request = new SFSystemCalculatorEndRequest(); var response = manager.ContinueWorkflow <SFSystemCalculatorEndRequest, SFSystemCalculatorEndResponse>(workflowDefinition, request, "end"); StringBuilder sb = new StringBuilder(); if (response != null) { sb.Append($"Il risultato e': { response.Result}"); } return(sb.ToString()); }