nocode-js/sequential-workflow-designer

Expose walker publicly on Designer

Closed this issue · 2 comments

The only way i see to easily query a Definition is to manually create an instance of DefinitionWalker to use. It seems like it would be more appropriate to use the walker property of Designer, but it is private.

private constructor(
private readonly view: DesignerView,
private readonly state: DesignerState,
private readonly walker: DefinitionWalker,
private readonly historyController: HistoryController | undefined,
private readonly api: DesignerApi
) {}

This instance seems to be the source of "truth" for the rules to visiting/querying a definition. Would you consider changing walker to be a public property?

Hello @goldsam! Thanks for reporting. Basically you can use the DefinitionWalker class by creating an own instance.

import { DefinitionWalker } from 'sequential-workflow-model';
const walker = new DefinitionWalker();

Check this article.

But your idea I think may be helpfull for vanilla JavaScript applications, so please check the 0.18.1 version.

designer.getWalker();

@b4rtaz Thank you so much for the quick response! That change was very helpful!