Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

dashboard broke after excecution of a workflow #27

Open
guido-dimasi opened this issue Oct 23, 2020 · 4 comments
Open

dashboard broke after excecution of a workflow #27

guido-dimasi opened this issue Oct 23, 2020 · 4 comments

Comments

@guido-dimasi
Copy link

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)

@sfmskywalker
Copy link
Member

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?

@guido-dimasi
Copy link
Author

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, Func2 invokeAction)"

after that it also broke the page as the previous attempt

@guido-dimasi
Copy link
Author

this is the project
TestElsa2.zip

it contains:

  • EF context for the ELSA tables
  • EF context for my business logic persistance
  • 2 custom activities (create, delete)

@guido-dimasi
Copy link
Author

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, 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, Func2 invokeAction)

so i'm thinking i'm writing something wrong but i've no clue of what.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants