Open guido-dimasi opened 4 years ago
Can you elaborate on the broken dashboard part? What do you see? A screenshot might help. And perhaps there is a stack trace you can share?
just a blank page. on the browser console i've this message : The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.
the problem is that i've make a mistake writing the last node expression, but i've no clue of what error is.
in another attempt im now writing this expression "OK: " + Activities.CreaAsset.Asset.Id (javascript expression)
the debug console show this:
Elsa.Exceptions.WorkflowException: Error while evaluating JavaScript expression ""OK :" + Activities.CreaAsset.Asset.Id". Message: Activities is not defined
at Elsa.Expressions.WorkflowExpressionEvaluator.EvaluateAsync(IWorkflowExpression expression, Type type, WorkflowExecutionContext workflowExecutionContext, CancellationToken cancellationToken)
at Elsa.Extensions.WorkflowExpressionEvaluatorExtensions.EvaluateAsync[T](IWorkflowExpressionEvaluator evaluator, IWorkflowExpression1 expression, WorkflowExecutionContext workflowExecutionContext, CancellationToken cancellationToken) at Elsa.Activities.Http.Activities.WriteHttpResponse.OnExecuteAsync(WorkflowExecutionContext workflowContext, CancellationToken cancellationToken) at Elsa.Services.ActivityInvoker.InvokeAsync(WorkflowExecutionContext workflowContext, IActivity activity, Func
2 invokeAction)"
after that it also broke the page as the previous attempt
this is the project TestElsa2.zip
it contains:
i've tried to make the workflow in code:
public class InserimentoAssetWorkflow : IWorkflow { public void Build(IWorkflowBuilder builder) { builder .StartWith<ReceiveHttpRequest>( x => { x.Method = HttpMethod.Post.Method; x.Path = new Uri("/prova", UriKind.Relative); x.ReadContent = true; } ) .Then<SetVariable>( x => { x.VariableName = "Document"; x.ValueExpression = new JavaScriptExpression<ExpandoObject>("lastResult().Body"); } ) .Then<CreaAsset>( x => { x.Name = "CrazioneAsset"; x.Codice = new JavaScriptExpression<string>("Document.Codice"); x.Descrizione = new JavaScriptExpression<string>("Document.Descrizione"); x.Dealer = new JavaScriptExpression<string>("Document.Dealer"); } ) .Then<WriteHttpResponse>( x => { x.Content = new LiquidExpression<string>( "OK. ID: {{ Activities.CrazioneAsset.Asset.Id }} inserito correttamente. " ); x.ContentType = "text/html"; x.StatusCode = HttpStatusCode.OK; x.ResponseHeaders = new LiteralExpression("X-Powered-By=Elsa Workflows"); } ); } }
the output console write:
Elsa.Exceptions.WorkflowException: Error while evaluating Liquid expression "OK. ID: {{ Activities.CrazioneAsset.Asset }} inserito correttamente. ". Message: Object reference not set to an instance of an object. at Elsa.Expressions.WorkflowExpressionEvaluator.EvaluateAsync(IWorkflowExpression expression, Type type, WorkflowExecutionContext workflowExecutionContext, CancellationToken cancellationToken) at Elsa.Extensions.WorkflowExpressionEvaluatorExtensions.EvaluateAsync[T](IWorkflowExpressionEvaluator evaluator, IWorkflowExpression
1 expression, WorkflowExecutionContext workflowExecutionContext, CancellationToken cancellationToken)
at Elsa.Activities.Http.Activities.WriteHttpResponse.OnExecuteAsync(WorkflowExecutionContext workflowContext, CancellationToken cancellationToken)
at Elsa.Services.ActivityInvoker.InvokeAsync(WorkflowExecutionContext workflowContext, IActivity activity, Func2 invokeAction)
so i'm thinking i'm writing something wrong but i've no clue of what.
i've made a simple workflow that use a custom activity. the custom activity ends with this code:
Output.SetVariable("Test", assetsDTO); return Done();
the last node of my workflow is a simple httpwriterespose. inside i've wrote:
"Entity inserted: "+ Test.ID + " succes!"
after using post man to call this simple workflow it return 204 and also if i try to acces http://localhost:50777/Elsa/workflow-definition i've just an empty page
if i wanna re run my project i've to recreate the entire db (i'm using SQL server with entity framework)
PS: the custom activity runs ok (i've tested this workflow with the dubug)