Comments (4)
Based on the context provided, it seems you are looking to enhance the Elsa Workflow activities to support lists and dictionaries of inputs. Your proposed enhancement involves modifying classes such as InputDescriptor
and ActivityDescriber
to accommodate these complex input types. You have also mentioned that you have a working solution and are ready to create a pull request.
Given that you are not using the designer and are not proposing designer changes at this time, the enhancement would primarily benefit users who are developing workflows programmatically. The use cases you've described, such as sending messages to a list of users with varying input types (Literal, Variable, JavaScript) and running scripts with unique sets of named arguments, are clear examples of the flexibility this enhancement would provide.
The impact of this enhancement would allow for more sophisticated input mapping in activities, which could be beneficial for workflows that require dynamic input configurations. Although this does not currently involve changes to the designer, it could potentially lead to future enhancements that make these capabilities available in the designer interface.
Your additional context with the example activity WriteMultiLine
demonstrates how a list of inputs could be used in practice.
If you have already been using this solution for a few weeks and it is stable, creating a pull request would be the next step. It would be important to ensure that your changes are well-documented and include tests to verify the new functionality. Additionally, it would be beneficial to consider how these changes might be integrated with the designer in the future, even if that is not part of the current proposal.
Before proceeding, it would be advisable to discuss this enhancement with the Elsa Workflow maintainers to ensure that it aligns with the project's roadmap and to gather any feedback they might have.
This comment was generated by Glime.
from elsa-core.
I don't understand why this doesn't meet what you are wanting?
public Input<List<string>> Recipients { get; set; } = default;
It's just a list of strings anyways and is effectively the same thing you're proposing just without extra steps on the consumer.
from elsa-core.
Hey @rboylesDev, thanks for your comment. For sure what you suggest would work if a simple list of names is available. But if the list were to come from a variety of sources, then I believe it would be easier to specify the inputs separately. I added a sample workflow showing both of the new input constructs that I am suggesting at the bottom of this message.
The RunScript
activity has an input called arguments
which consists of two string arguments (one Literal, one JavaScript) as well as a boolean argument.
The SendMessage
activity has an input called to
which consists of three string elements (one Literal, one JavaScript, and one Variable).
Does this help demonstrate why a simple Input<List<string>>
would not be sufficient?
Sample Workflow Definition
{
"type": "Elsa.Flowchart",
"version": 1,
"id": "flowchart",
"nodeId": "120f407f-bff7-4b3a-a8b6-c57ee625dc42:flowchart",
"metadata": {},
"customProperties": {
"source": "WorkflowMapper.cs:61"
},
"activities": [
{
"id": "Event_1hehqwh",
"nodeId": "120f407f-bff7-4b3a-a8b6-c57ee625dc42:flowchart:Event_1hehqwh",
"name": "",
"type": "Elsa.Start",
"version": 1,
"customProperties": {
"source": "WorkflowMapper.cs:121"
},
"metadata": {}
},
{
"id": "Event_01xeq36",
"nodeId": "120f407f-bff7-4b3a-a8b6-c57ee625dc42:flowchart:Event_01xeq36",
"name": "",
"type": "Elsa.End",
"version": 1,
"customProperties": {
"source": "WorkflowMapper.cs:126"
},
"metadata": {}
},
{
"scriptDependency": {
"type": "Script",
"name": "LookupCompanyContactEmail",
"scope": "Private",
"onlyAllowPublic": false
},
"arguments": {
"CompanyName": {
"typeName": "String",
"expression": {
"type": "Literal",
"value": "Apex Inc"
}
},
"ContactName": {
"typeName": "String",
"expression": {
"type": "JavaScript",
"value": "getInput(\"ContactName\");"
}
},
"SomeBooleanArg": {
"typeName": "Boolean",
"expression": {
"type": "Literal",
"value": "true"
}
}
},
"result": {
"typeName": "Object",
"memoryReference": {
"id": "9d8307aafd7641f88a0ce53a5e58fedb"
}
},
"id": "Activity_10k4yr3",
"nodeId": "120f407f-bff7-4b3a-a8b6-c57ee625dc42:flowchart:Activity_10k4yr3",
"name": "RunScript",
"type": "Sample.RunScript",
"version": 1,
"customProperties": {},
"metadata": {}
},
{
"subject": {
"typeName": "String",
"expression": {
"type": "Literal",
"value": "This is a test message"
}
},
"body": {
"typeName": "String",
"expression": {
"type": "JavaScript",
"value": "getInput(\"MessageBody\");"
}
},
"to": [
{
"typeName": "String",
"expression": {
"type": "Literal",
"value": "admin"
}
},
{
"typeName": "String",
"expression": {
"type": "JavaScript",
"value": "getInput(\"MessageRecipient\");"
}
},
{
"typeName": "String",
"expression": {
"type": "Variable",
"value": {
"id": "9d8307aafd7641f88a0ce53a5e58fedb",
"name": "AnotherRecipient",
"typeName": "String",
"value": "ralph",
"storageDriverTypeName": "Elsa.Workflows.Services.WorkflowStorageDriver, Elsa.Workflows.Core"
}
}
}
],
"cc": [],
"bcc": [],
"id": "Activity_1ndpz3j",
"nodeId": "120f407f-bff7-4b3a-a8b6-c57ee625dc42:flowchart:Activity_1ndpz3j",
"name": "SendMessage",
"type": "Sample.SendMessage",
"version": 1,
"customProperties": {},
"metadata": {}
}
],
"connections": [
{
"source": {
"activity": "Event_1hehqwh"
},
"target": {
"activity": "Activity_10k4yr3"
}
},
{
"source": {
"activity": "Activity_10k4yr3"
},
"target": {
"activity": "Activity_1ndpz3j"
}
},
{
"source": {
"activity": "Activity_1ndpz3j"
},
"target": {
"activity": "Event_01xeq36"
}
}
]
}
from elsa-core.
@bobhauser, ah I see. We have a few of these cases and the way we've handled (worked around?) it is to have a javascript activity, or Set Variable activity with value input using Javascript, that combines all the inputs into a single list before passing to our activity. While it's not natively taking in multiple inputs, it does work now without additional Elsa changes.
from elsa-core.
Related Issues (20)
- [BUG]when publish workflow RouteExtensions path is null throw exception System.NullReferenceException:“Object reference not set to an instance of an object.”
- [BUG] System.NullReferenceException: 'Object reference not set to an instance of an object.'
- [BUG] Can´t save CodeActivity from example. Error "..must bind to an object property or field on deserialization." HOT 1
- [BUG] `Array.Sort()` Not Working as Expected on `ExpandoObject` Fields
- [BUG] Exception when saving workflow execution logs after running alterations when using MongoDb storage HOT 3
- [BUG] `Variable` and `Input` Do Not Work for Custom `IWorkflowProvider` Implementation HOT 3
- [FEAT] Add JS Functions and Activities for Encoding/Decoding Bytes and Base64
- [BUG] workflow die when i use activity Elsa.Delay in elsa 3
- [BUG] Error when Set Variable from Json data HOT 2
- [BUG] Remote Login default from elsa 3 and add custom login page
- [BUG] Revert Variable Accessors Returning Copy Instead of Reference
- [DOC] <Parallel execution of activities>how to use this feature?
- [FEAT] Bookmarks- Custom Payload Comparison
- Garbage Elsa, you haven't helped solve so many problems for so long. What else are you doing with open source? HOT 3
- MongoDB: Bulk Write Operation Error with '$type' Field in Elsa Workflows HOT 1
- [BUG] Collection serialization 3.2.0rc5
- [BUG]Memory usage cannot be reduced
- [BUG] Disappear Activity Elsa V3
- [BUG] NullReferenceException When Parsing a HttpResponse without content-type
- [FEAT]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elsa-core.