A structured template package for vNext workflow components with domain-based architecture. This package provides a foundation for building scalable workflow systems with schemas, tasks, views, functions, and extensions.
- Domain-Driven Architecture: Organized by business domains with clear separation of concerns
- Component-Based Structure: Modular design with schemas, workflows, tasks, views, functions, and extensions
- JSON Schema Validation: Built-in validation for all component definitions
- Template System: Ready-to-use template structure for new vNext projects
- Type Safety: Structured exports with clear APIs for accessing components
npm install @my-organization/{domainName}npm install --save-dev @my-organization/{domainName}vnext-template/
βββ {domainName}/ # Domain-specific components
β βββ Extensions/ # Extension definitions
β βββ Functions/ # Function definitions
β βββ Schemas/ # JSON schema definitions
β βββ Tasks/ # Task definitions
β βββ Views/ # View components
β βββ Workflows/ # Workflow definitions
βββ index.js # Main entry point
βββ vnext.config.json # Domain configuration
βββ package.json # Package metadata
const vnextTemplate = require('@my-organization/{domainName}');
// Get domain configuration
const config = vnextTemplate.getDomainConfig();
console.log('Domain config:', config);
// Get all available component types
const availableTypes = vnextTemplate.getAvailableTypes();
console.log('Available types:', availableTypes);
// Output: ['schemas', 'workflows', 'tasks', 'views', 'functions', 'extensions']
// Get domain name
const domainName = vnextTemplate.getDomainName();
console.log('Domain name:', domainName);// Load specific component types
const schemas = vnextTemplate.getSchemas();
const workflows = vnextTemplate.getWorkflows();
const tasks = vnextTemplate.getTasks();
const views = vnextTemplate.getViews();
const functions = vnextTemplate.getFunctions();
const extensions = vnextTemplate.getExtensions();
// Example: Working with schemas
Object.keys(schemas).forEach(schemaName => {
console.log(`Schema: ${schemaName}`, schemas[schemaName]);
});
// Example: Working with workflows
Object.keys(workflows).forEach(workflowName => {
console.log(`Workflow: ${workflowName}`, workflows[workflowName]);
});const vnext = require('my-organization/{domainName}');
class WorkflowManager {
constructor() {
this.config = vnext.getDomainConfig();
this.schemas = vnext.getSchemas();
this.workflows = vnext.getWorkflows();
}
validateWorkflow(workflowData) {
// Use loaded schemas for validation
// Implementation depends on your validation library
}
executeWorkflow(workflowName) {
const workflow = this.workflows[workflowName];
if (!workflow) {
throw new Error(`Workflow ${workflowName} not found`);
}
// Execute workflow logic
}
}
const manager = new WorkflowManager();Returns the domain configuration from vnext.config.json.
Returns: Object | null - The configuration object or null if not found
Loads all JSON schema files from the Schemas directory.
Returns: Object - Key-value pairs of schema names and definitions
Loads all workflow definitions from the Workflows directory.
Returns: Object - Key-value pairs of workflow names and definitions
Loads all task definitions from the Tasks directory.
Returns: Object - Key-value pairs of task names and definitions
Loads all view definitions from the Views directory.
Returns: Object - Key-value pairs of view names and definitions
Loads all function definitions from the Functions directory.
Returns: Object - Key-value pairs of function names and definitions
Loads all extension definitions from the Extensions directory.
Returns: Object - Key-value pairs of extension names and definitions
Returns an array of available component types.
Returns: Array<string> - Available component types
Returns the name of the domain directory.
Returns: string | null - Domain directory name or null if not found
- Each domain is represented as a separate directory
- Components are organized by type within domains
- Clear separation between different workflow concerns
- Schemas: JSON Schema definitions for data validation
- Workflows: Business process definitions and state machines
- Tasks: Individual task definitions and configurations
- Views: User interface and presentation components
- Functions: Reusable business logic functions
- Extensions: Plugin and extension definitions
Example: user-registration.1.0.0.json
npm testnpm run validateThe template follows strict schema validation rules:
- Schema instances MUST include:
key,version,domain,flow,flowVersion - Schema instances MUST NOT include:
labels(labels belong to business logic) - Optional fields:
id,eTag(added by platform in production)
- References use:
domain+workflow+ (idORkey) + optionalversion - NO
typeproperty in references -workflowfield serves as type - Always use local file references:
reference.json#/attributes
All lifecycle workflows must have:
draft(type: "start") - Initial stateactive(type: "normal") - Active statepassive(type: "finish") - Final state
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This package is maintained by the Burgan Tech team as part of our commitment to building scalable, domain-driven workflow solutions.
For support and questions:
- Create an issue on GitHub
- Contact the development team at dev@burgan-tech.com
Made with β€οΈ by the Burgan Tech team