@eang/core
Version:
eang - model driven enterprise event processing
38 lines • 1.13 kB
JavaScript
export class FunctionStartContext {
rootObjectId;
entities;
data;
inIds;
outIds;
functionInputMapping;
inEventInstances;
constructor(contextOpts) {
Object.assign(this, contextOpts);
this.rootObjectId = contextOpts.rootObjectId;
this.data = contextOpts.data || {};
this.entities = contextOpts.entities || [];
this.inEventInstances = this.entities.filter((obj) => this.inIds?.includes(obj.id) && obj.typeOf === 'Event_Instance');
}
/**
* Gets the root object that owns this context
* @returns The root object or undefined if not found
*/
getRootObject() {
return this.entities?.find((obj) => obj.id === this.rootObjectId);
}
}
export class FunctionStopContext {
data;
err;
entityEvents;
events;
errEvents;
constructor(contextOpts) {
this.data = contextOpts.data;
this.err = contextOpts.err;
this.entityEvents = contextOpts.entityEvents;
this.events = contextOpts.events;
this.errEvents = contextOpts.errEvents;
}
}
//# sourceMappingURL=context.js.map