sono nuovo a Windows Workflow [WF] e sono interessati a valutare WF per scopi aziendali. Ho deciso di lavorare attraverso un introductionWF4RC, attività WriteLine genera errori su StringWriter assegnato a TextWriter
[TestMethod]
public void TestMethod()
{
TextWriter writer = new StringWriter();
Sequence sequence = new Sequence
{
Activities =
{
// so, assigning a reference type [eg StringWriter]
// as target is prohibited in WF4RC. what or how do
// i assign a target? introduction cited above may
// not be current [ie may be Beta2, not RC] so ... ?
new WriteLine { Text = "Hello", TextWriter = writer },
new WriteLine { Text = "World", TextWriter = writer }
}
};
// !!! BLOWS UP !!!
WorkflowInvoker.Invoke (sequence);
}
e incontrato
Metodo SomeTests.SomeTests.TestMethod ha gettato un'eccezione: System.Activities.InvalidWorkflowException: I seguenti errori sono stati riscontrati durante l'elaborazione della struttura del flusso di lavoro: 'Letterale': Literal supporta solo i tipi di valore e il tipo immutabile System.String. Il tipo System.IO.TextWriter non può essere utilizzato come letterale.
Poking in giro, ho trovato this article che descrive quello che sembra essere l'errore che vedo sopra.
Essendo nuovo in WF, non capisco il cambiamento o il metodo prescritto per aggirare il problema. Quindi, la mia domanda è,
Con WF4RC, come si usa [correttamente] l'attività WriteLine
?
Ho avuto un problema simile con il tentativo di impostare una stringa []. Il LambdaValue funzionava. Ma ho anche notato che se usi InArgument funziona anche, ed è probabilmente il modo in cui dovrebbe essere fatto. –
TrueEddie