elsa-core icon indicating copy to clipboard operation
elsa-core copied to clipboard

[BUG] Programmatic nested Flowcharts null in designer

Open MaxBrooks114 opened this issue 1 year ago • 2 comments

Description

I created a programmatic flowchart workflow where there are some activities which are then followed by an If statement. When viewing that workflow in the designer if I try to see the body of the if activity get a null reference error. This also happens with ForEach statements as well.

Steps to Reproduce

create a flowchart programmatic workflow with an if activity and have the "then" attribute be a continuation of the workflow instead of just a writeline or single activity, namely it should have activties after it e.g. Event => SetVariable => If (then => ForEach( => new FlowChart( any activities)))

MaxBrooks114 avatar May 22 '24 19:05 MaxBrooks114

To address the issue you're experiencing with the null reference error when viewing the body of an If activity in the designer, it's important to ensure that the If activity is properly configured with its Then and Else branches. If the Then branch contains a ForEach activity that leads to a new FlowChart, it's crucial that all activities within that FlowChart are correctly instantiated and connected.

Based on the context provided, it seems like there might be a problem with how the activities are being instantiated or connected within the Then branch of the If activity. Here are some steps you can take to troubleshoot the issue:

  1. Verify that all activities within the Then branch, including those within the ForEach and subsequent FlowChart, are properly instantiated and have all required properties set.
  2. Ensure that the connections between activities are correctly defined.
  3. Check for any missing or null references within the Then branch that could be causing the null reference error.
  4. Look for any discrepancies between the programmatic workflow definition and the designer's expectations. The designer might not be able to interpret certain programmatic constructs if they are not represented in a way that the designer can understand.

If you continue to experience issues, consider consulting the Elsa documentation for more detailed guidance on defining workflows programmatically and ensuring compatibility with the designer. Additionally, you may want to reach out to the Elsa community or support channels for assistance with specific issues related to the designer's interpretation of programmatic workflows.

For further reference, you can review the Elsa documentation on programmatic workflows and designer workflows, as well as the core concepts of activities and flowcharts:

  • Programmatic vs. Designer Workflows: https://v3.elsaworkflows.io/docs/core-concepts/programmatic-vs-designer
  • Activity: https://v3.elsaworkflows.io/docs/core-concepts/activity
  • Flowchart Workflows: https://v3.elsaworkflows.io/docs/core-concepts/flowchart

If the issue persists and seems to be a bug, you may want to report it on the Elsa GitHub issues page, providing a detailed description and steps to reproduce the problem:

  • Elsa GitHub Issues: https://github.com/elsa-workflows/elsa-core/issues

This comment was generated by Glime.

glime-ai[bot] avatar May 22 '24 19:05 glime-ai[bot]

I'm wondering if it is how the workflow appears in the studio. I have a value and conditions set for the workflow's setvariable and if condition, but when looking at it in the studio it is blank/ null as well as when i export it as JSON.

MaxBrooks114 avatar May 24 '24 21:05 MaxBrooks114