Giter Site home page Giter Site logo

Comments (7)

glime-ai avatar glime-ai commented on June 9, 2024

Based on the information provided, it seems that the issue you are encountering is related to the JavaScript expressions getOutputFrom("RSPSearch1", "Result") and getOutputFrom("RSPSearch2", "Result") returning null when the FormSubmit2 activity is resumed after being suspended. This behavior suggests that the outputs of the RSPSearch1 and RSPSearch2 activities are not being persisted or are not accessible upon resumption.

To address this issue, you may want to ensure that the outputs of the RSPSearch1 and RSPSearch2 activities are being correctly stored and that they are available in the workflow context when the FormSubmit2 activity is resumed. Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Verify that the outputs of RSPSearch1 and RSPSearch2 are being set correctly before the workflow is suspended.
  2. Check if the workflow context is being saved and loaded correctly upon suspension and resumption.
  3. Ensure that the JavaScript functions getOutputFrom are implemented correctly and are capable of retrieving the outputs from the specified activities.
  4. Review the workflow definition and instance JSON files to confirm that the outputs are present and correctly formatted.
  5. If you are using Elsa version 2 or above, make sure you are following the updated way of defining and accessing activity inputs and outputs as per the documentation.

If the issue persists, you may want to reach out to the Elsa community or support channels with specific details about your implementation and the errors you are encountering. Additionally, you can review the Elsa documentation and resources for more information on defining and using activities, handling inputs and outputs, and managing workflow execution.

Please let me know if you need further assistance or if there are any specific areas you would like me to elaborate on.

from elsa-core.

sfmskywalker avatar sfmskywalker commented on June 9, 2024

The issue is that activity output is transient, which means that when the workflow enters the Suspended state, the output will be lost. When the workflow is then resumed, the Form Submit activity will fail as you reported, given that it is trying to get activity output that will result in null values being returned.

To fix this, you can capture the activities output using a persistent variable.
The Form Submit activity can then use those variables, which will have a copy of the output values.

Here's a workflow definition that demonstrates this:

image

modified-workflow-definition.json

This will fix the loss of output values.
However, I ran into another issue that your custom activities uncovered; upon attempting to deserialize the elements of the PersonSearchResults collection, which is a class that derives from List<PersonSearchResult>, the serializer fails to recognize that it should deserialize the individual elements as PersonSearchResult, and instead, deserializes them as ExpandoObjects.

I have pushed a fix to the main branch for this. If you want to take advantage of this fix, please update your Elsa package references to the latest 3.2.0 preview build (3.2.0-preview.1393 or higher).

from elsa-core.

sfmskywalker avatar sfmskywalker commented on June 9, 2024

Based on the information provided, it seems that the issue you are encountering is related to the JavaScript expressions getOutputFrom("RSPSearch1", "Result") and getOutputFrom("RSPSearch2", "Result") returning null when the FormSubmit2 activity is resumed after being suspended. This behavior suggests that the outputs of the RSPSearch1 and RSPSearch2 activities are not being persisted or are not accessible upon resumption.

The bot was on to something 😄

from elsa-core.

sfmskywalker avatar sfmskywalker commented on June 9, 2024

I will proceed to closing this issue, but feel free to continue the conversation.

from elsa-core.

sfmskywalker avatar sfmskywalker commented on June 9, 2024

More information about activity output & direct access can be found here: https://elsa-workflows.github.io/elsa-documentation/custom-activities.html#direct-access

from elsa-core.

msavencov avatar msavencov commented on June 9, 2024

Hi @sfmskywalker
Thanks for the clarified answer and sorry for the late response (I've been very busy these past weeks).
At that time, I solved the issue in a similar way by setting a variable using the "Set Variable" activity in front of my "Submit Form".

Now I have another question: can I instruct the engine to always save the results of the desired activities (or all activities in my workflow) so that I can access them from anywhere in the workflow? And how to enable that if engine allows that.

Thanks, have a nice day!

from elsa-core.

sfmskywalker avatar sfmskywalker commented on June 9, 2024

Hi @msavencov , no worries, I am happy to hear you found a workaround 👍🏻
For now, the engine doesn't have a configurable way to store an activity's output, but do I have been thinking about adding this capability.

from elsa-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.