Comments (2)
Absolutely. The component allows you to define activity definitions in 3 ways:
- Programmatically using JavaScript
- Declaratively using the
<wf-custom-activity>
tags - As a web component built with StencilJS
Ultimately, an activity definition is a plain old JavaScript object that looks like this:
interface ActivityDefinition {
type: string;
displayName: string;
description: string;
category: string;
properties: Array<ActivityPropertyDescriptor>;
getOutcomes(activity: Activity): string[];
}
Your back-end could simply store these as JSON. However one thing I might not have thought through enough is the getOutcomes
field, which expects a function value that computes the available outcomes. In most scenarios, this will simply return an array of strings, but in some scenarios, that array will be based on certain attributes of a given activity.
For example, the Fork
activity allows the user to specify a comma-separated list of branches. The getOutcomes
function for this activity will take these branch names and return them as an array of outcomes.
Could you maybe tell a little bit more about your use case on how you were thinking to store activity definitions in your back-end?
from elsa-designer.
I gave this some more thought, and I think I found a neat solution to allow for data-driven activity definitions. I am planning on building a reference dashboard application with Orchard Core that would allow an admin to define activity definitions from the dashboard.
Ultimately, you will be able to define activity definitions using any of the following approaches:
- Using
ActivityManager
, a singleton service that exposesaddActivityDefinition
, accepting a simple object describing the activity. - Using
<wf-activity-definition>
, exposing attributes to configure an activity definition. - Using StencilJS to define custom activities.
Options 2 and 3 are complete optional, as they all ultimately just add a simple activity definition in the form of an object (serializable from and to JSON) to the internal store.
I'll close this issue and create a new one to track progress on this work, but feel free to keep posting here if you want.
from elsa-designer.
Related Issues (14)
- Implement Icons
- Bpmn gateways HOT 2
- I need info about your library HOT 3
- Library not working as standalone HOT 9
- how to use it in vuejs ? HOT 2
- Integration with Angular HOT 12
- lastClickedLocation not set correctly HOT 1
- ELSA workflow designer not supporting in angular 9 application HOT 1
- dashboard broke after excecution of a workflow HOT 4
- How to use it on blazor HOT 3
- Languages HOT 3
- Activity Definitions as plain objects HOT 1
- Implement filtering in Activity Picker HOT 1
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-designer.