You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Godspeed project starts as a service only, and depends on some event source like http graphql etc to start. If we want to setup datasources and run some workflows, we can not do it via a command line.
The Solution
Allow a developer to run workflows from a command.
Remove the condition that there must be atleast one eventsource. If no event sources are found, events folder will also be ignored. Rest of the things like config, functions, mappings, datasources will be loaded.
How will we solve
When initializing godspeed instance, allow every param to be optional and also pass withoutEventSource as true as second argument to godspeedInstance.initialize()
In GodspeedParams, following changes will happen
Allow developer to call workflows without running any eventsource like this.
importGodspeed,{GodspeedParams,logger,childLogger}from"@godspeedsystems/core";constparams: GodspeedParams={// eventsFolderPath: undefined,workflowsFolderPath: 'dist/functions',definitionsFolderPath: 'dist/definitions',configFolderPath: '/config',datasourcesFolderPath: 'dist/datasources',// eventsourcesFolderPath: undefined,mappingsFolderPath: 'dist/mappings',pluginsFolderPath: 'dist/plugins'}// create a godspeed instance without events and eventsources folder paths. Do remember to pass true for initializing without eventsources. Otherwise project will load from default value of eventsource folder. That will be something you do not want for invoking a workflow directly.constgsApp=newGodspeed(params,true);// initilize the Godspeed App// this is responsible to load all kind of entitiesgsApp.initialize().then(async()=>{logger.info('project initialized');awaitexecute();}).catch(console.error)asyncfunctionexecute(){awaitgsApp.executeWorkflow('model.device.create',{body: {name: 'mastersilv3r'}});}
The text was updated successfully, but these errors were encountered:
The Problem
Currently Godspeed project starts as a service only, and depends on some event source like http graphql etc to start. If we want to setup datasources and run some workflows, we can not do it via a command line.
The Solution
Allow a developer to run workflows from a command.
Remove the condition that there must be atleast one eventsource. If no event sources are found, events folder will also be ignored. Rest of the things like config, functions, mappings, datasources will be loaded.
How will we solve
withoutEventSource
as true as second argument togodspeedInstance.initialize()
GodspeedParams
, following changes will happenThe text was updated successfully, but these errors were encountered: