Add Documentation for Process Builder and CLAUDE Guidance

- Introduced CLAUDE.md to provide comprehensive guidance for developers working with the codebase, including common development commands, architecture overview, and security considerations.
- Added Process Builder Pages Analysis document detailing the implementation, features, and improvement opportunities for the process-builder section, including in-depth analysis of index.vue, manage.vue, and analytics pages.
- Updated README.md to reflect the new documentation structure and enhance clarity on system capabilities and usage guidelines.
- Removed outdated JSON files related to process definitions and variables to streamline the documentation and ensure relevance.
- Enhanced overall documentation organization for better accessibility and understanding of the Corrad ProcessMaker platform.
This commit is contained in:
Md Afiq Iskandar 2025-07-15 10:17:10 +08:00
parent ba08d2e466
commit 2f1d3964c8
7 changed files with 2144 additions and 4440 deletions

214
CLAUDE.md Normal file
View File

@ -0,0 +1,214 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Common Development Commands
### Development Server
```bash
yarn dev # Start development server
yarn build # Build for production
yarn build:new # Build with pre/post-build scripts
yarn preview # Preview production build
yarn generate # Generate static site
```
### Database Operations
```bash
yarn prisma # Pull DB schema, generate client, and start dev server
npx prisma generate # Generate Prisma client only
npx prisma db pull # Pull database schema
npx prisma studio # Open Prisma Studio for database management
```
### Code Quality
```bash
npx eslint . # Run ESLint
npx prettier --write . # Format code with Prettier
```
## Architecture Overview
### Technology Stack
- **Framework**: Nuxt 3 with Vue 3 Composition API
- **Database**: MySQL with Prisma ORM
- **State Management**: Pinia stores
- **UI Framework**: Tailwind CSS + Custom Rose UI components
- **Forms**: FormKit with custom extensions
- **Process Visualization**: Vue Flow for BPMN diagrams
- **Authentication**: JWT-based with custom middleware
### Core System Components
This is a **Business Process Management (BPM) platform** with two primary modules:
#### 1. Process Builder (`/process-builder/`)
Visual BPMN workflow designer with three main pages:
- **index.vue**: Main process designer (drag-and-drop BPMN editor, ~40k tokens)
- **manage.vue**: Process management dashboard with metrics and CRUD operations
- **analytics/[id].vue**: Process analytics and journey visualization
#### 2. Form Builder (`/form-builder/`)
Dynamic form creator with conditional logic, validation, and JavaScript API integration
### State Management Architecture
**Primary Stores:**
- `processBuilder.js`: Process design, node management, auto-save, history tracking
- `formBuilder.js`: Form components, validation, custom scripts, preview data
- `variableStore.js`: Global process variables and data flow management
- `user.js`: Authentication and user session management
**Store Patterns:**
- All stores use Pinia with persistence
- Reactive state updates trigger UI changes automatically
- Centralized error handling and loading states
- Auto-save functionality prevents data loss
### Database Schema (Prisma)
**Core Entities:**
- `process`: BPMN process definitions with JSON schema, versioning, and templates
- `form`: Dynamic form configurations with custom scripts and validation
- `caseInstance`: Process execution instances with status tracking
- `task`: User tasks within process cases
- `user/role/userrole`: Authentication and RBAC system
**Key Relationships:**
- Forms can be embedded in process tasks
- Process variables flow between forms and process nodes
- Complete audit trail through `processHistory` and `formHistory`
- Case timeline tracking for process execution monitoring
### Component Architecture
**Process Flow Components (`/components/process-flow/`):**
- `ProcessFlowCanvas.vue`: Main BPMN editor using Vue Flow
- `ProcessBuilderComponents.vue`: Draggable component palette
- Node Configuration Modals: Specialized modals for each BPMN node type
- `VariableManager.vue`: Process variable management interface
**Form Components (`/components/formkit/`):**
- Custom FormKit inputs with enhanced functionality
- Conditional logic engine for dynamic field visibility
- JavaScript API integration for real-time calculations
**Rose UI Components (`/components/rs-*/`):**
- Custom design system components (buttons, modals, cards, etc.)
- Consistent styling and behavior across the application
### API Architecture (`/server/api/`)
**RESTful Structure:**
- `/api/forms/`: CRUD operations for forms with history tracking
- `/api/process/`: Process management, publishing, execution
- `/api/tasks/`: Task assignment and completion
- `/api/devtool/`: Development utilities (ORM, code editor, etc.)
**Special Endpoints:**
- Form field extraction: `/api/forms/[formId]/fields.get.js`
- Process analytics: `/api/process/dashboard/summary.get.js`
- Version management: `/api/forms/[id]/history.get.js`
### Configuration Files (`/docs/json/`)
**Critical System Configurations:**
- `formComponents.json`: Complete form structure for Malaysian Asnaf registration system
- `processDefinition.json`: BPMN process flow definitions with nodes and edges
- `processVariables.json`: 100+ process variables for data management
- `customScript.js`: Form conditional logic and field visibility rules
These JSON files define a production Malaysian welfare application system with complex business rules.
### Development Patterns
**Vue 3 Composition API Usage:**
- Use `ref()` for primitive reactive data
- Use `shallowRef()` for large objects (like Vue Flow nodes) to avoid deep reactivity
- Implement proper cleanup in `onUnmounted()` for timers and event listeners
- Use `watch()` for complex reactive logic, `computed()` for derived state
**State Management Patterns:**
- Store actions handle all business logic and API calls
- Components focus on presentation and user interaction
- Use store getters for computed values across components
- Implement optimistic updates with error rollback
**Form Builder Patterns:**
- FormKit schema generation from component configurations
- Conditional logic engine evaluates field visibility in real-time
- JavaScript API provides hooks for custom calculations and validations
- Custom script execution sandbox for security
**Process Builder Patterns:**
- Vue Flow integration for professional BPMN rendering
- Node configuration through specialized modal components
- Auto-save with debouncing to prevent data loss
- History tracking for undo/redo functionality
### Security Considerations
**Authentication:**
- JWT tokens with refresh mechanism
- Role-based access control (RBAC) through `user/role/userrole` models
- Route-level middleware protection
**Data Security:**
- XSS protection disabled for specific API routes (devtool, forms)
- Rate limiting: 200 requests per minute
- Input validation through FormKit and Prisma
- SQL injection protection through Prisma ORM
**Script Execution:**
- Form custom scripts run in 'safe' mode by default
- Script execution sandbox prevents direct DOM access
- Advanced mode available for power users with additional permissions
### Key Implementation Details
**Auto-save System:**
- Debounced saves every 2 seconds after changes
- Unsaved changes protection with navigation guards
- Visual indicators for save status
**Process Execution:**
- BPMN-compliant process engine
- Task assignment and routing based on process definition
- Variable management throughout process lifecycle
- Integration points for external APIs and services
**Form System:**
- Dynamic component rendering from JSON schema
- Real-time validation and conditional logic
- Preview mode for form testing
- Import/export functionality for form templates
**Performance Optimizations:**
- Lazy loading for heavy components (modals, editors)
- Virtual scrolling for large lists
- Optimized API calls with loading states
- Bundle splitting for reduced initial load times
### Development Tips
**Working with Large Files:**
- `pages/process-builder/index.vue` is ~40k tokens - consider code splitting
- Use component lazy loading for modal components
- Implement proper loading states for better UX
**Database Changes:**
- Always run `npx prisma generate` after schema changes
- Use migrations for production database updates
- Test with realistic data volumes
**Testing Process Flows:**
- Use the process management dashboard for testing
- Create test cases in `/execution/` interface
- Monitor variables through the Variable Manager
**Custom Scripts:**
- Test in 'safe' mode first before enabling 'advanced' mode
- Use the JavaScript API documentation for available functions
- Implement proper error handling for custom scripts
This codebase represents a sophisticated, production-ready BPM platform with comprehensive process design, form building, and execution capabilities.

View File

@ -1,95 +1,295 @@
# Corrad ProcessMaker Documentation
Welcome to the Corrad ProcessMaker documentation. This repository contains comprehensive guides and technical documentation for developers and users of the Corrad ProcessMaker platform.
This documentation provides a comprehensive overview of the Corrad ProcessMaker system, its features, architecture, and usage guidelines.
## Documentation Structure
## System Overview
The documentation is organized into the following sections:
Corrad ProcessMaker is a sophisticated business process management (BPM) platform built with modern web technologies. It enables organizations to design, automate, and manage complex business workflows with an intuitive drag-and-drop interface. The system follows BPMN (Business Process Model and Notation) standards to create executable business processes.
### Overview
- [Project Overview](./overview/PROJECT_OVERVIEW.md) - Introduction to the system and its capabilities
- [Architecture](./overview/ARCHITECTURE.md) - Technical architecture of the system
- [Development Guide](./overview/DEVELOPMENT_GUIDE.md) - Guide for new developers
### Core Purpose
### Process Builder
- [User Guide](./process-builder/USER_GUIDE.md) - How to use the Process Builder
- [Technical Guide](./process-builder/TECHNICAL_GUIDE.md) - Technical details of the Process Builder implementation
- [Roadmap](./process-builder/ROADMAP.md) - Planned improvements for the Process Builder
The platform serves as a complete solution for:
- **Process Automation**: Streamline business workflows with visual process design
- **Form Management**: Create dynamic, interactive forms with conditional logic
- **Data Collection**: Gather and process structured data through forms and APIs
- **Workflow Execution**: Run automated processes with user tasks and decision points
- **Documentation Management**: Handle document uploads, verification, and processing
### Form Builder
- [User Guide](./form-builder/USER_GUIDE.md) - How to use the Form Builder
- [Technical Guide](./form-builder/TECHNICAL_GUIDE.md) - Technical details of the Form Builder implementation
- [JavaScript API Reference](./form-builder/JAVASCRIPT_API.md) - Complete JavaScript API for dynamic forms and calculations
- [Grid System Guide](./form-builder/grid-system.md) - Visual grid system and layout documentation
- [Roadmap](./form-builder/ROADMAP.md) - Development roadmap and missing essential features checklist
## Key Features
### Process Execution
- [User Guide](./process-execution/USER_GUIDE.md) - How to use the Process Execution interface
- [Technical Guide](./process-execution/TECHNICAL_GUIDE.md) - Technical details of the Process Execution implementation
### 1. Visual Process Builder
- **Drag-and-Drop Interface**: Intuitive process design with BPMN-compliant elements
- **Node Types**: Start/End events, User Tasks, Service Tasks, Gateways, and Sub-processes
- **Flow Control**: Conditional branching, parallel execution, and loop handling
- **Integration Points**: API calls, script execution, and external service connections
## Getting Started
### 2. Dynamic Form Builder
- **Component Library**: Comprehensive set of form components (text, select, radio, checkbox, date, file upload)
- **Conditional Logic**: Show/hide fields based on user input with visual condition builder
- **Validation Rules**: Built-in and custom validation with real-time feedback
- **Multi-step Forms**: Wizard-style forms with progress tracking
- **Responsive Design**: Mobile-friendly forms that adapt to different screen sizes
New to the project? We recommend reading the documentation in this order:
### 3. Process Execution Engine
- **Task Management**: Assign and track user tasks with role-based access
- **Variable Management**: Handle data flow throughout the process lifecycle
- **API Integration**: Connect with external services and databases
- **Notification System**: Automated alerts and status updates
- **Audit Trail**: Complete logging of process execution and user actions
1. [Project Overview](./overview/PROJECT_OVERVIEW.md) - Understand what the system does
2. [Development Guide](./overview/DEVELOPMENT_GUIDE.md) - Learn how to set up your development environment
3. [Architecture](./overview/ARCHITECTURE.md) - Understand the technical architecture
4. User guides for components you'll be working with
5. Technical guides for deeper implementation details
### 4. Advanced Capabilities
- **JavaScript API**: Custom scripting for calculations and business logic
- **File Handling**: Secure document upload, storage, and verification
- **Role-based Security**: Granular permissions and access control
- **Process Templates**: Reusable process definitions and form templates
- **Analytics**: Process performance monitoring and reporting
## Contributing to Documentation
## Architecture
When contributing to this documentation:
### Technology Stack
- **Frontend**: Nuxt 3, Vue 3, TypeScript
- **Backend**: Node.js with Nitro server
- **Database**: MySQL/MariaDB with Prisma ORM
- **UI Framework**: Tailwind CSS with custom Rose UI components
- **Form Engine**: FormKit with custom extensions
- **Process Visualization**: Vue Flow for BPMN diagram rendering
- **State Management**: Pinia for reactive state handling
1. Keep the structure organized and logical
2. Update cross-references when moving or renaming files
3. Ensure code examples are up-to-date
4. Include diagrams where helpful
5. Keep the language clear and concise
### System Components
## Contact
#### Frontend Architecture
```
├── components/ # Reusable Vue components
│ ├── process-flow/ # Process builder components
│ ├── formkit/ # Custom form components
│ └── rs-*/ # Rose UI component library
├── pages/ # Application routes and views
│ ├── process-builder/ # Process design interface
│ ├── form-builder/ # Form design interface
│ └── execution/ # Process execution views
├── stores/ # Pinia state management
├── composables/ # Reusable composition functions
└── plugins/ # Vue/Nuxt plugins
```
If you have questions about this documentation or need help with the system, please contact the development team.
#### Backend Architecture
```
├── server/ # API endpoints and server logic
│ ├── api/ # REST API routes
│ ├── middleware/ # Server middleware
│ └── utils/ # Utility functions
├── prisma/ # Database schema and migrations
└── docs/ # Configuration and documentation
```
Last updated: December 2024
## Configuration Files in docs/ Folder
## Recent Updates
The `docs/` folder contains critical configuration files that define the system's behavior:
### December 2024 - Major Process Builder Enhancements
- **Enhanced Form Node Configuration**: Complete redesign of form task configuration with step-by-step workflow
- **Input/Output Mappings**: Bidirectional data flow between process variables and form fields
- **Field Conditions**: Dynamic field behavior based on process variables (readonly, hidden, required states)
- **4-Point Connection System**: All nodes now have 4 connection points (top, bottom, left, right) to prevent edge overlaps
- **Improved Visual Design**: Better handle styling with hover effects and connection state feedback
- **Auto-Save Mechanism**: Reliable data persistence for form configurations and mappings
- **Variable Integration**: Seamless integration with process variables for form pre-filling and data capture
- **Conditional Logic**: Support for complex field conditions with multiple operators and actions
- **Process Settings Management**: Comprehensive process configuration with 5 organized tabs:
- **Process Info**: Name, description, priority, category, ownership management
- **Execution Settings**: Process type, timeouts, parallel execution, error recovery
- **Variables & Data**: Data persistence policies, logging, encryption, retention controls
- **Permissions**: Role-based access control, execution permissions, approval workflows
- **JSON Export**: Complete configuration export with metadata for API integration
- **Advanced Configuration Options**: Professional-grade settings comparable to enterprise BPM platforms
- **Enhanced State Management**: Improved process store with settings persistence and history tracking
### Form Configuration (`docs/json/form/`)
### December 2024 - Process Builder Critical Fixes & Database Integration
- **Database Integration**: Complete API system with REST endpoints for all process operations
- **URL Parameter Support**: Direct process linking via `/process-builder?id={uuid}` pattern
- **Save Functionality**: Enhanced with success/error messages and proper state management
- **Navigation Improvements**: Fixed unsaved changes detection and automatic URL synchronization
- **Connection Dragging Fix**: Resolved Vue Flow interference preventing connector dragging
- **Backward Compatibility**: Legacy process definitions with embedded nodes automatically upgraded
- **Toast Notifications**: Comprehensive user feedback system for all operations
- **Performance Optimizations**: Reduced re-renders and improved memory management
- **Error Handling**: Robust validation and graceful error recovery throughout system
- **UI Consistency**: Updated form builder management to match process builder design patterns
#### formComponents.json
Contains the complete form structure definition for the Malaysian Asnaf (welfare recipient) registration system. This configuration includes:
### December 2024 - Major Form Builder Enhancements
- **JavaScript Execution Engine**: Added FormScriptEngine component for real-time calculations
- **Dynamic Field Updates**: Implemented onFieldChange and onLoad event handlers
- **Real-time Calculations**: Forms now support live mathematical calculations and field dependencies
- **Enhanced Debugging**: Comprehensive logging and error handling for JavaScript execution
- **API Documentation**: Complete JavaScript API reference with practical examples
- **Performance Optimizations**: Improved change detection and memory management
- **Security Enhancements**: Sandboxed JavaScript execution with input validation
- **Section A**: Personal information collection (name, ID type, citizenship, gender, race, education)
- **Section B**: Dependent information and family details
- **Banking Information**: Account details for payment processing
- **Educational Background**: School and institution information
- **Conditional Logic**: Field visibility rules based on user selections
Key features demonstrated:
- Multi-language support (Bahasa Malaysia)
- Complex conditional field display logic
- Validation rules for required fields
- Grid-based responsive layout
- Structured data collection for government processes
#### customScript.js
JavaScript code that implements dynamic form behavior:
- Field visibility control based on user selections
- Real-time conditional logic execution
- Form validation and data manipulation
- Integration with the FormKit JavaScript API
### Process Configuration (`docs/json/process-builder/`)
#### processDefinition.json
Defines the complete business process workflow structure including:
- **Process Nodes**: Forms, API calls, scripts, decision points
- **Edge Connections**: Flow between process steps
- **Data Mapping**: Variable assignments between steps
- **Conditional Routing**: Business rules for process flow
#### processVariables.json
Comprehensive variable definitions used throughout the process:
- **Form Data Variables**: User input from forms
- **API Response Variables**: Data from external service calls
- **Calculation Variables**: Computed values (e.g., Had Kifayah calculations)
- **Status Variables**: Process state and flow control
- **Configuration Variables**: System settings and constants
Key variable categories:
- Applicant personal information
- Financial data and calculations
- Document verification status
- Process flow control variables
- Error handling and notifications
## How to Use the System
### For Process Designers
1. **Creating a New Process**
- Navigate to Process Builder
- Drag nodes from the component palette
- Connect nodes with flow arrows
- Configure each node's properties
- Set up variables and data mapping
2. **Designing Forms**
- Access Form Builder interface
- Drag form components onto the canvas
- Configure field properties and validation
- Set up conditional logic rules
- Preview and test the form
3. **Process Deployment**
- Test process flows in development mode
- Validate all connections and configurations
- Deploy to production environment
- Monitor process execution
### For End Users
1. **Starting a Process**
- Access the process from the execution interface
- Complete required forms step by step
- Upload necessary documents
- Submit for processing
2. **Task Management**
- View assigned tasks in inbox
- Complete user tasks as they become available
- Track process progress
- Receive notifications on status changes
### For Administrators
1. **System Configuration**
- Manage user roles and permissions
- Configure API endpoints and integrations
- Set up notification templates
- Monitor system performance
2. **Process Management**
- Monitor active process instances
- Handle exceptions and errors
- Generate reports and analytics
- Maintain process templates
## Use Cases
### Malaysian Asnaf Registration System
The current configuration demonstrates a comprehensive welfare application system:
- **Multi-step Application Process**: Guided user journey through application stages
- **Family Information Collection**: Detailed dependent and household member data
- **Financial Assessment**: Had Kifayah (poverty line) calculations
- **Document Verification**: Upload and validation of supporting documents
- **Decision Processing**: Automated eligibility determination
- **Approval Workflow**: Multi-level review and approval process
### General Business Processes
The platform supports various business scenarios:
- **Employee Onboarding**: HR processes with document collection and approvals
- **Purchase Requests**: Procurement workflows with budget approvals
- **Customer Service**: Ticket management and resolution processes
- **Compliance Reporting**: Regulatory submission and review processes
- **Project Management**: Task assignment and milestone tracking
## Integration Capabilities
### API Integration
- REST API endpoints for external system integration
- Real-time data synchronization
- Webhook support for event-driven processes
- Custom authentication and authorization
### Database Connectivity
- Multiple database support through Prisma ORM
- Data migration and schema management
- Query optimization and caching
- Backup and recovery procedures
### Third-party Services
- Email and SMS notification services
- Document storage and management systems
- Payment gateway integration
- Identity verification services
## Security Features
### Authentication & Authorization
- Multi-factor authentication support
- Role-based access control (RBAC)
- Session management and timeout
- API key management
### Data Protection
- Encryption at rest and in transit
- PII (Personally Identifiable Information) protection
- Audit logging and compliance
- GDPR and data privacy compliance
### Process Security
- Secure document handling
- Input validation and sanitization
- XSS and injection attack prevention
- Secure API communications
## Development Guidelines
### Code Structure
- Follow Vue 3 Composition API patterns
- Use TypeScript for type safety
- Implement component-based architecture
- Maintain clear separation of concerns
### Best Practices
- Write comprehensive tests for business logic
- Document API endpoints and data models
- Follow consistent naming conventions
- Implement proper error handling
### Configuration Management
- Use environment variables for sensitive data
- Maintain separate configurations for different environments
- Version control all configuration changes
- Document configuration dependencies
## Support and Maintenance
### System Monitoring
- Real-time performance monitoring
- Error tracking and alerting
- Process execution analytics
- User activity monitoring
### Backup and Recovery
- Automated database backups
- Process definition versioning
- Configuration backup procedures
- Disaster recovery planning
### Updates and Upgrades
- Regular security updates
- Feature enhancement releases
- Database migration procedures
- Backward compatibility maintenance
## Conclusion
Corrad ProcessMaker provides a comprehensive solution for business process automation with its powerful visual design tools, dynamic form capabilities, and robust execution engine. The system's modular architecture and extensive configuration options make it suitable for a wide range of business applications, from simple approval workflows to complex multi-stage processes like the Malaysian Asnaf registration system demonstrated in this documentation.
The platform's strength lies in its ability to handle complex business logic while maintaining an intuitive user interface for both process designers and end users. With proper configuration and customization, it can adapt to virtually any business process automation requirement.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,13 @@
"value": null,
"description": "Nama bank from Section B"
},
"nextAction": {
"name": "nextAction",
"type": "string",
"scope": "global",
"value": null,
"description": "Next action to be taken in the process"
},
"radio9Copy": {
"name": "radio9Copy",
"type": "string",
@ -149,6 +156,13 @@
"value": null,
"description": "Form field for jenis KP 3"
},
"jenisBantuan": {
"name": "jenisBantuan",
"type": "string",
"scope": "global",
"value": null,
"description": "Type of assistance (tunai/barangan/perkhidmatan)"
},
"loginSuccess": {
"name": "loginSuccess",
"type": "boolean",
@ -216,15 +230,15 @@
"name": "applicantName",
"type": "string",
"scope": "global",
"value": "Ahmad Bin Ali",
"description": "Applicant name for verification form"
"value": null,
"description": "Applicant's full name"
},
"applicationId": {
"name": "applicationId",
"type": "string",
"scope": "global",
"value": "APP-1751871528249",
"description": "Generated application ID from script processing"
"value": null,
"description": "Unique application reference number"
},
"carianLoginId": {
"name": "carianLoginId",
@ -310,6 +324,20 @@
"value": null,
"description": "Text field for nyatakan lain-lain"
},
"paymentAmount": {
"name": "paymentAmount",
"type": "number",
"scope": "global",
"value": null,
"description": "Amount approved for payment (RM)"
},
"paymentMethod": {
"name": "paymentMethod",
"type": "string",
"scope": "global",
"value": null,
"description": "Payment method (cash/bank_transfer)"
},
"poskodSekolah": {
"name": "poskodSekolah",
"type": "string",
@ -317,12 +345,19 @@
"value": null,
"description": "Poskod sekolah from Section B"
},
"statusMessage": {
"name": "statusMessage",
"type": "string",
"scope": "global",
"value": null,
"description": "Human-readable status message"
},
"applicantEmail": {
"name": "applicantEmail",
"type": "string",
"scope": "global",
"value": "ahmad.ali@example.com",
"description": "Applicant email address for notifications"
"value": null,
"description": "Applicant's email address for notifications"
},
"caraPembayaran": {
"name": "caraPembayaran",
@ -394,6 +429,13 @@
"value": null,
"description": "Family status based on had kifayah calculation"
},
"submissionDate": {
"name": "submissionDate",
"type": "string",
"scope": "global",
"value": null,
"description": "Date when application was submitted"
},
"syorPengesahan": {
"name": "syorPengesahan",
"type": "string",
@ -443,6 +485,13 @@
"value": "850101-01-1234",
"description": "No Kad Pengenalan"
},
"pengesahanError": {
"name": "pengesahanError",
"type": "string",
"scope": "global",
"value": null,
"description": "General error message from pengesahan process"
},
"penilaianAwalId": {
"name": "penilaianAwalId",
"type": "string",
@ -527,6 +576,13 @@
"value": 1000,
"description": "Net family income"
},
"pengesahanStatus": {
"name": "pengesahanStatus",
"type": "string",
"scope": "global",
"value": null,
"description": "Verification status (lulus/ditolak/dokumen_tambahan/semakan_lanjut)"
},
"readyForDecision": {
"name": "readyForDecision",
"type": "boolean",
@ -548,6 +604,13 @@
"value": null,
"description": "Date when verification was completed"
},
"applicationStatus": {
"name": "applicationStatus",
"type": "string",
"scope": "global",
"value": "pending",
"description": "Current application status (pending/approved/rejected/under_review)"
},
"baseKifayahAmount": {
"name": "baseKifayahAmount",
"type": "decimal",
@ -555,6 +618,13 @@
"value": null,
"description": "Base Had Kifayah amount for head of household (RM 1,215.00)"
},
"catatanPengesahan": {
"name": "catatanPengesahan",
"type": "string",
"scope": "global",
"value": null,
"description": "Verification notes from officer"
},
"documentsComplete": {
"name": "documentsComplete",
"type": "boolean",
@ -674,6 +744,13 @@
"value": null,
"description": "Childcare allowance for 12 years and below (RM 330.00)"
},
"conditionalMessage": {
"name": "conditionalMessage",
"type": "string",
"scope": "global",
"value": null,
"description": "Conditional message based on application status"
},
"dateMasukislamCopy": {
"name": "dateMasukislamCopy",
"type": "string",
@ -695,6 +772,13 @@
"value": null,
"description": "Jenis kad tanggungan from Section B"
},
"pengesahanApiError": {
"name": "pengesahanApiError",
"type": "object",
"scope": "global",
"value": null,
"description": "API error from verification submission"
},
"penilaianAwalError": {
"name": "penilaianAwalError",
"type": "string",
@ -751,6 +835,13 @@
"value": null,
"description": "Status of initial assessment submission"
},
"processingTimeHours": {
"name": "processingTimeHours",
"type": "number",
"scope": "global",
"value": null,
"description": "Total processing time in hours"
},
"profileUpdateStatus": {
"name": "profileUpdateStatus",
"type": "string",
@ -884,6 +975,20 @@
"value": null,
"description": "Result from kifayah eligibility analysis API"
},
"pengesahanApiResponse": {
"name": "pengesahanApiResponse",
"type": "object",
"scope": "global",
"value": null,
"description": "API response from verification submission"
},
"pengesahanScriptError": {
"name": "pengesahanScriptError",
"type": "object",
"scope": "global",
"value": null,
"description": "Script error from pengesahan processing"
},
"penilaianAwalApiError": {
"name": "penilaianAwalApiError",
"type": "string",
@ -912,6 +1017,13 @@
"value": 0,
"description": "Total family had kifayah amount"
},
"verificationCompleted": {
"name": "verificationCompleted",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether verification process is completed"
},
"verificationProcessed": {
"name": "verificationProcessed",
"type": "boolean",
@ -919,6 +1031,13 @@
"value": null,
"description": "Whether verification processing is complete"
},
"verificationTimestamp": {
"name": "verificationTimestamp",
"type": "string",
"scope": "global",
"value": null,
"description": "Timestamp when verification was completed"
},
"warganegaraTanggungan": {
"name": "warganegaraTanggungan",
"type": "string",
@ -1024,6 +1143,13 @@
"value": null,
"description": "Select field for status perkahwinan"
},
"sendPendingNotification": {
"name": "sendPendingNotification",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether to send pending status notification"
},
"tempatMenetapTanggungan": {
"name": "tempatMenetapTanggungan",
"type": "string",
@ -1059,6 +1185,13 @@
"value": 1215,
"description": "Base had kifayah amount for head of family (RM 1,215.00)"
},
"jumlahBantuanDicadangkan": {
"name": "jumlahBantuanDicadangkan",
"type": "number",
"scope": "global",
"value": null,
"description": "Recommended assistance amount (RM)"
},
"kifayahCalculationResult": {
"name": "kifayahCalculationResult",
"type": "object",
@ -1101,6 +1234,13 @@
"value": null,
"description": "Error from Penilaian Awal script execution"
},
"sendApprovalNotification": {
"name": "sendApprovalNotification",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether to send approval notification"
},
"tarikhMulaKfamTanggungan": {
"name": "tarikhMulaKfamTanggungan",
"type": "string",
@ -1108,6 +1248,13 @@
"value": null,
"description": "Tarikh mula KFAM tanggungan from Section B"
},
"dokumenTambahanDiperlukan": {
"name": "dokumenTambahanDiperlukan",
"type": "array",
"scope": "global",
"value": null,
"description": "List of additional documents required"
},
"hadKifayahTanggungan7to17": {
"name": "hadKifayahTanggungan7to17",
"type": "number",
@ -1115,6 +1262,13 @@
"value": 408,
"description": "Had kifayah amount per dependent aged 7-17 years (RM 408.00)"
},
"sendRejectionNotification": {
"name": "sendRejectionNotification",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether to send rejection notification"
},
"statusRecommendationError": {
"name": "statusRecommendationError",
"type": "object",
@ -1226,180 +1380,5 @@
"scope": "global",
"value": 0,
"description": "Total had kifayah for dependents aged 6 years and below"
},
"pengesahanStatus": {
"name": "pengesahanStatus",
"type": "string",
"scope": "global",
"value": null,
"description": "Verification status (lulus/ditolak/dokumen_tambahan/semakan_lanjut)"
},
"catatanPengesahan": {
"name": "catatanPengesahan",
"type": "string",
"scope": "global",
"value": null,
"description": "Verification notes from officer"
},
"dokumenTambahanDiperlukan": {
"name": "dokumenTambahanDiperlukan",
"type": "array",
"scope": "global",
"value": null,
"description": "List of additional documents required"
},
"jumlahBantuanDicadangkan": {
"name": "jumlahBantuanDicadangkan",
"type": "number",
"scope": "global",
"value": null,
"description": "Recommended assistance amount (RM)"
},
"jenisBantuan": {
"name": "jenisBantuan",
"type": "string",
"scope": "global",
"value": null,
"description": "Type of assistance (tunai/barangan/perkhidmatan)"
},
"applicationStatus": {
"name": "applicationStatus",
"type": "string",
"scope": "global",
"value": "pending",
"description": "Current application status (pending/approved/rejected/under_review)"
},
"statusMessage": {
"name": "statusMessage",
"type": "string",
"scope": "global",
"value": null,
"description": "Human-readable status message"
},
"nextAction": {
"name": "nextAction",
"type": "string",
"scope": "global",
"value": null,
"description": "Next action to be taken in the process"
},
"verificationCompleted": {
"name": "verificationCompleted",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether verification process is completed"
},
"verificationTimestamp": {
"name": "verificationTimestamp",
"type": "string",
"scope": "global",
"value": null,
"description": "Timestamp when verification was completed"
},
"processingTimeHours": {
"name": "processingTimeHours",
"type": "number",
"scope": "global",
"value": null,
"description": "Total processing time in hours"
},
"sendApprovalNotification": {
"name": "sendApprovalNotification",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether to send approval notification"
},
"sendRejectionNotification": {
"name": "sendRejectionNotification",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether to send rejection notification"
},
"sendPendingNotification": {
"name": "sendPendingNotification",
"type": "boolean",
"scope": "global",
"value": false,
"description": "Whether to send pending status notification"
},
"paymentAmount": {
"name": "paymentAmount",
"type": "number",
"scope": "global",
"value": null,
"description": "Amount approved for payment (RM)"
},
"paymentMethod": {
"name": "paymentMethod",
"type": "string",
"scope": "global",
"value": null,
"description": "Payment method (cash/bank_transfer)"
},
"applicantEmail": {
"name": "applicantEmail",
"type": "string",
"scope": "global",
"value": null,
"description": "Applicant's email address for notifications"
},
"applicantName": {
"name": "applicantName",
"type": "string",
"scope": "global",
"value": null,
"description": "Applicant's full name"
},
"applicationId": {
"name": "applicationId",
"type": "string",
"scope": "global",
"value": null,
"description": "Unique application reference number"
},
"submissionDate": {
"name": "submissionDate",
"type": "string",
"scope": "global",
"value": null,
"description": "Date when application was submitted"
},
"conditionalMessage": {
"name": "conditionalMessage",
"type": "string",
"scope": "global",
"value": null,
"description": "Conditional message based on application status"
},
"pengesahanApiResponse": {
"name": "pengesahanApiResponse",
"type": "object",
"scope": "global",
"value": null,
"description": "API response from verification submission"
},
"pengesahanApiError": {
"name": "pengesahanApiError",
"type": "object",
"scope": "global",
"value": null,
"description": "API error from verification submission"
},
"pengesahanScriptError": {
"name": "pengesahanScriptError",
"type": "object",
"scope": "global",
"value": null,
"description": "Script error from pengesahan processing"
},
"pengesahanError": {
"name": "pengesahanError",
"type": "string",
"scope": "global",
"value": null,
"description": "General error message from pengesahan process"
}
}

View File

@ -0,0 +1,338 @@
# Process Builder Pages Analysis
This document provides a comprehensive analysis of the process-builder pages in the Corrad ProcessMaker system, including their current implementation, features, and improvement opportunities.
## Overview
The process-builder section consists of three main pages:
1. **index.vue** - Main process builder/designer interface
2. **manage.vue** - Process management dashboard
3. **analytics/[id].vue** - Process analytics and monitoring
## Page-by-Page Analysis
### 1. Process Builder (index.vue)
**Purpose**: Main visual process design interface where users create and edit business processes using a drag-and-drop BPMN editor.
#### Key Features
- **Visual Process Designer**: Full-featured BPMN editor with Vue Flow integration
- **Component Palette**: Drag-and-drop components (Start/End, Forms, APIs, Scripts, Gateways, etc.)
- **Node Configuration**: Dedicated modals for configuring each node type
- **Variable Management**: Built-in variable manager for process data
- **Auto-save**: Automatic saving with unsaved changes protection
- **Process Templates**: Template system for reusable process definitions
- **Process History**: Version control and history tracking
- **Responsive Design**: Mobile-friendly interface with collapsible panels
#### Technical Implementation
```javascript
// Core Dependencies
- Vue 3 Composition API
- Vue Flow for BPMN rendering
- Pinia store for state management
- Process Builder Store for centralized logic
- Multiple specialized modals for node configuration
// Key Components Used
- ProcessFlowCanvas (main canvas)
- ProcessBuilderComponents (component palette)
- FormSelector, VariableManager
- Various node configuration modals
- ProcessTemplatesModal, ProcessSettingsModal
```
#### File Structure Insights
- **Large file** (~40k tokens) indicating complex functionality
- **Comprehensive imports** showing integration with 15+ specialized components
- **State management** using refs and reactive variables
- **Modal system** for node configuration with dedicated modals per node type
- **Navigation handling** with unsaved changes protection
#### Current State
- ✅ **Feature Complete**: Full BPMN editing capabilities
- ✅ **Node Types**: Supports all major BPMN elements
- ✅ **Integration Ready**: API and form integration built-in
- ✅ **User Experience**: Auto-save, templates, history
- ⚠️ **Performance**: Large file size may impact load times
- ⚠️ **Maintainability**: Complex component structure
### 2. Process Management Dashboard (manage.vue)
**Purpose**: Central hub for managing processes with dashboard view, process listing, and administrative functions.
#### Key Features
##### Dashboard View
- **Real-time Metrics**: Process counts, case statistics, completion rates
- **Visual Analytics**: Process distribution charts, case status visualization
- **Recent Activity**: Activity feed with user actions and timestamps
- **Quick Actions**: Fast access to common operations
##### List View
- **Advanced Filtering**: Search, status, and category filters
- **Process Management**: Edit, publish, duplicate, delete operations
- **Bulk Operations**: Multi-select for batch actions
- **Status Management**: Draft, published, archived, deleted states
##### Process Operations
- **CRUD Operations**: Full create, read, update, delete functionality
- **Publishing Workflow**: Draft → Published state management
- **Process Duplication**: Clone existing processes
- **Soft Delete**: Move to trash with restore capability
#### Technical Implementation
```javascript
// State Management
- Process store integration
- Real-time data fetching
- Filter and search state
- Loading states and error handling
// API Integration
- Dashboard summary endpoint
- Process CRUD operations
- Bulk operations support
- Analytics data fetching
// UI Components
- Custom Rose UI components
- FormKit for forms and inputs
- Icon system with Material Symbols
- Responsive grid layouts
```
#### User Experience Features
- **Dual View Mode**: Dashboard and list views with seamless switching
- **Real-time Updates**: Live data refresh and status updates
- **Responsive Design**: Mobile-optimized interface
- **Progressive Loading**: Skeleton states and loading indicators
- **Error Handling**: Graceful error states with fallbacks
#### Current State
- ✅ **Comprehensive**: Full process lifecycle management
- ✅ **User-Friendly**: Intuitive interface with clear actions
- ✅ **Performance**: Optimized API calls and loading states
- ✅ **Responsive**: Works well on all device sizes
- ⚠️ **Charts**: Placeholder chart implementations (not fully functional)
- ⚠️ **Analytics**: Basic metrics, could be enhanced
### 3. Process Analytics ([id].vue)
**Purpose**: Detailed analytics and monitoring for individual processes with journey visualization.
#### Key Features
##### Overview Tab
- **Key Performance Metrics**: Total cases, completion rates, success rates
- **Time Analytics**: Average completion times and efficiency metrics
- **User Analytics**: Top users and department statistics
- **Visual Indicators**: Color-coded status indicators and progress bars
##### Journey Tab
- **Process Flow Visualization**: Step-by-step journey mapping
- **Completion Tracking**: Success rates per step
- **Performance Analysis**: Time spent at each step
- **Issue Identification**: Bottlenecks and problem areas highlighted
- **Visual Timeline**: Connected flow showing process progression
#### Technical Implementation
```javascript
// Data Structure
- Mock analytics data (ready for API integration)
- Journey step definitions with metrics
- User performance tracking
- Time-based analytics
// Visualization
- Custom timeline component
- Progress bars and completion indicators
- Icon-based node type identification
- Responsive table layouts
// Navigation
- Tab-based interface
- Back navigation to management
- Edit process integration
```
#### Analytics Metrics
- **Process Execution**: Cases started, completed, abandoned
- **Performance**: Average completion times, bottlenecks
- **User Behavior**: Most active users, department usage
- **Quality**: Success rates, error rates, retry counts
- **Journey Analysis**: Step-by-step conversion funnel
#### Current State
- ✅ **Well-Structured**: Clear analytics framework
- ✅ **Visual Design**: Excellent journey visualization
- ✅ **User Experience**: Intuitive tab navigation
- ⚠️ **Mock Data**: Uses placeholder data (API integration needed)
- ⚠️ **Chart Integration**: Could benefit from chart libraries
- ⚠️ **Real-time**: Static data, needs live updates
## Architecture Analysis
### Strengths
1. **Comprehensive Functionality**
- Complete BPMN process design capabilities
- Full process lifecycle management
- Detailed analytics and monitoring
2. **Modern Technology Stack**
- Vue 3 Composition API for optimal performance
- Pinia for reactive state management
- Vue Flow for professional diagram rendering
- FormKit for consistent form handling
3. **User Experience**
- Intuitive drag-and-drop interface
- Responsive design across all pages
- Auto-save and unsaved changes protection
- Comprehensive error handling
4. **Modular Architecture**
- Separated concerns across pages
- Reusable component library
- Centralized store management
- Clean navigation structure
### Areas for Improvement
1. **Performance Optimization**
- Large file sizes (index.vue ~40k tokens)
- Potential bundle splitting opportunities
- Lazy loading for modal components
- Canvas rendering optimization
2. **Data Integration**
- Analytics page uses mock data
- Chart implementation placeholders
- Real-time data updates needed
- API error handling enhancement
3. **Code Organization**
- Complex component structure in index.vue
- Potential for refactoring into smaller components
- Shared utilities extraction
- Type safety improvements
4. **Feature Enhancements**
- Advanced analytics charts
- Real-time collaboration
- Process versioning UI
- Export/import functionality
- Advanced filtering options
## Component Dependencies
### Process Builder (index.vue)
```
├── ProcessFlowCanvas (main editor)
├── ProcessBuilderComponents (palette)
├── Node Configuration Modals:
│ ├── FormNodeConfigurationModal
│ ├── ApiNodeConfigurationModal
│ ├── BusinessRuleNodeConfigurationModal
│ ├── NotificationNodeConfigurationModal
│ ├── ScriptNodeConfigurationModal
│ ├── HtmlNodeConfigurationModal
│ └── SubprocessNodeConfigurationModal
├── Supporting Components:
│ ├── FormSelector
│ ├── VariableManager
│ ├── GatewayConditionManager
│ ├── ProcessTemplatesModal
│ ├── ProcessSettingsModal
│ └── ProcessHistoryModal
```
### Management Dashboard (manage.vue)
```
├── Rose UI Components:
│ ├── RsButton, RsBadge, RsModal
│ └── FormKit components
├── Dashboard Charts (placeholder)
├── Process List Components
└── Filter and Search Components
```
### Analytics ([id].vue)
```
├── Tab Navigation System
├── Metrics Display Components
├── Journey Timeline Component
├── User Analytics Table
└── Visual Progress Indicators
```
## State Management
### Process Builder Store Integration
- **Centralized Logic**: All process operations through store
- **Reactive Updates**: Real-time UI updates on data changes
- **Persistence**: Auto-save and local storage integration
- **Error Handling**: Consistent error states across pages
### Key Store Methods Used
```javascript
// Process Management
- fetchProcesses()
- createProcess()
- updateProcess()
- deleteProcess()
- publishProcess()
- duplicateProcess()
// Process Building
- loadProcess()
- saveProcess()
- addNode()
- updateNode()
- addEdge()
// Analytics
- getProcessAnalytics()
- getProcessJourney()
```
## Recommended Improvements
### 1. Performance Optimization
- **Code Splitting**: Break index.vue into smaller, lazy-loaded components
- **Virtual Scrolling**: For large process lists in manage.vue
- **Canvas Optimization**: Implement viewport-based rendering for large processes
- **Bundle Analysis**: Identify and optimize heavy dependencies
### 2. Real-time Features
- **Live Analytics**: WebSocket integration for real-time metrics
- **Collaboration**: Multi-user editing with conflict resolution
- **Auto-refresh**: Periodic data updates for dashboard
- **Push Notifications**: Process completion alerts
### 3. Enhanced Analytics
- **Chart Integration**: Implement Chart.js or similar for visual analytics
- **Advanced Metrics**: More detailed performance analytics
- **Custom Reports**: User-configurable analytics dashboards
- **Export Features**: PDF/Excel export for analytics data
### 4. User Experience
- **Keyboard Shortcuts**: Power user features for faster editing
- **Advanced Search**: Full-text search across process content
- **Bulk Operations**: Multi-select operations in management view
- **Process Comparison**: Side-by-side process comparison tools
### 5. Developer Experience
- **TypeScript**: Add type safety across all components
- **Testing**: Unit and integration test coverage
- **Documentation**: Component and API documentation
- **Storybook**: Component library documentation
## Conclusion
The process-builder pages represent a sophisticated and well-architected business process management system. The implementation demonstrates strong technical competency with modern Vue.js patterns, comprehensive functionality, and excellent user experience design.
The system is production-ready with room for performance optimizations and feature enhancements. The modular architecture provides a solid foundation for future development and scaling.
Key strengths include the complete BPMN implementation, intuitive user interfaces, and comprehensive process management capabilities. The main opportunities lie in performance optimization, real-time features, and enhanced analytics visualization.