Comments (4)
Check the getStepParents
method of the Designer
class.
const step: Step = ...;
const parents = designer.getStepParents(step);
const parent = parents[parents.length - 1];
This method returns a path to a passed step. To get parent you need to read one before last item.
from sequential-workflow-designer.
BTW: your suggestion would cause that the model would contain data redundancy. What is completely wrong. Now the model contains all information what you need. You can easily get an access to previous/next/parent/child step, but it requires a definition search.
from sequential-workflow-designer.
@lechuhuuha is the problem solved?
from sequential-workflow-designer.
@lechuhuuha is the problem solved?
Thanks
i just loop in the sequence and get the next index of step then its work perfect
Here is the code
designer = sequentialWorkflowDesigner.Designer.create(placeholder, startDefinition, configuration);
designer.onDefinitionChanged.subscribe(newDefinition => {
refreshValidationStatus();
if (!newDefinition && !newDefinition.sequence) {
return;
}
const modifiedArray = [];
processBranches(newDefinition.sequence, modifiedArray);
console.clear();
console.log(JSON.stringify(modifiedArray, null, 2));
// console.log('the definition has changed', newDefinition.sequence);
});
function processBranches(branches, modifiedArray) {
branches.forEach((element, index) => {
const modifiedElement = { ...element };
const childIndex = `${index + 1}`;
if (branches[childIndex]) {
modifiedElement.child = branches[childIndex].id;
}
modifiedArray.push(modifiedElement);
if (modifiedElement.componentType === 'switch') {
const yesBranch = modifiedElement.branches.yes;
const noBranch = modifiedElement.branches.no;
if (yesBranch.length > 0) {
processBranches(yesBranch, modifiedArray);
}
if (noBranch.length > 0) {
processBranches(noBranch, modifiedArray);
}
}
});
}
from sequential-workflow-designer.
Related Issues (20)
- [react] Throw exception on undo action HOT 2
- How can I make the step a leaf step of the flow? HOT 4
- Convert JSON to Flow HOT 6
- Y-Scroll offset for step container HOT 2
- SUPER large algos crash chrome tab HOT 4
- How to add new context menu item? HOT 2
- Is there a way to highlight a step in the designer without actually selecting the step? HOT 2
- User defined conditionals? HOT 3
- public mutation events and pragmatically create actions HOT 1
- Customization of drop positions and styling HOT 5
- Property value of dynamically rendered component in designer isnt updating immediately HOT 5
- Can I change Ui template for task or switch HOT 5
- Start from a specific step HOT 2
- How to know is finished ? HOT 2
- Cannot use sequential-workflow-designer-react with React 17 and lower HOT 2
- Copy/Paste for steps HOT 2
- package 'sequential-workflow-designer' not found HOT 5
- Svelte Support for Sequential Workflow Designer HOT 3
- Scrolling issue in toolbox HOT 2
- Backspace key delete step 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 sequential-workflow-designer.