Integration
Forms integrate seamlessly with other Ambience modules to create complete business solutions. This section covers integration patterns and best practices.
Integration Overview
Forms can integrate with:
- Workflows - State-driven business processes
- ETL - Data validation, transformation, and processing
- Datasets - Dynamic data-driven components
- I18N - Multi-language support
- Workgroups - Multi-tenancy and access control
Workflow Integration
Connect forms to workflows for state-driven business processes:
- Create workflow instances from forms
- Display workflow state and history
- Send events to progress workflows
- Control UI based on workflow state
- Manage approvals and routing
Common Patterns
- Approval Workflows - Leave requests, expense claims, purchase orders
- Multi-Level Approvals - Sequential or parallel approvals
- Conditional Routing - Route based on data values
- Rejection with Resubmission - Allow users to fix and resubmit
Key Concepts
- elxPublic - Data visible to forms
- elxPrivate - Server-side data
- elxHistory - Audit trail
- elxRedirect - Navigation control
ETL Integration
Use ETL chains to validate, transform, and process form data:
- Validate form data with business rules
- Transform data before storage
- Integrate with external systems
- Send notifications
- Generate reports
Form-Specific ETL Steps
The Form module provides 14 specialized ETL steps:
form.NewFormInstance- Create form with workflowform.ReadFormResults- Query submitted dataform.AddAlert- Add alert messagesform.SetElxRedirect- Control navigation- And 10 more…
Validation with ETL
Create validation chainsets with: - Business rule validation - Database lookups - Cross-field validation - External system checks
Must include Validation Endpoint step to be recognized by forms.
Dataset Integration
Populate form components from database queries:
Dataset Components
- Dataset Select - Dropdown from query
- Dataset Chooser - Searchable selection
- Dataset Picker - Modal selection
- Dataset Multi-Select - Multiple selections
- Dataset Checkbox - Checkbox group
- Cascade Group - Cascading selections
Benefits
- Always current data
- Reduced maintenance
- Dynamic filtering
- Cascading dependencies
Internationalization (I18N)
Support multiple languages in forms:
- Base I18N - System translations
- Custom I18N - Your translations
- Language Resolution - Automatic detection
- Fallback Mechanism - Graceful degradation
Workgroup Integration
Organize and isolate forms with workgroups:
- Multi-Tenancy - Separate forms by department/organization
- Access Control - Users only see their workgroup’s forms
- Data Isolation - Form results isolated by workgroup
- Organizational Structure - Mirror company structure
Integration Patterns
Pattern 1: Form + Workflow + ETL
Complete business process solution
User fills form
↓
ETL validates data
↓
Workflow instance created
↓
ETL processes at each state
↓
Notifications sent
↓
Data stored
Use Cases: - Leave request with approval - Purchase order processing - Issue tracking - Document approval
Pattern 2: Form + Dataset + ETL
Dynamic data-driven form
Form loads
↓
Dataset queries populate dropdowns
↓
User selects values
↓
Cascading datasets filter
↓
User submits
↓
ETL processes and stores
Use Cases: - Customer order entry - Equipment reservation - Project assignment - Location-based forms
Pattern 3: Form + Workflow + Dataset
Process-driven form with dynamic data
Workflow instance created
↓
Form loads with workflow data
↓
Datasets populate based on workflow state
↓
User interacts
↓
Event sent to workflow
↓
State transitions
Use Cases: - Multi-step approvals with data lookup - Conditional routing with dynamic options - State-dependent form fields
Pattern 4: Form + ETL + External API
External system integration
User submits form
↓
ETL validates
↓
ETL calls external API
↓
Response processed
↓
Data stored
↓
User notified
Use Cases: - CRM integration - Payment processing - Address verification - Third-party service requests
Best Practices
1. Separation of Concerns
- Forms - User interface and data collection
- Workflows - Business process state management
- ETL - Data processing and transformation
2. Validation Layers
Use multiple validation layers: 1. Client-side - Immediate feedback 2. Server-side - Security 3. ETL - Business rules
3. Error Handling
- Return clear error messages
- Guide users to fix issues
- Log errors for debugging
- Provide fallback options
4. Performance
- Optimize dataset queries
- Use projections to limit data
- Cache frequently used data
- Minimize ETL chain complexity
5. Security
- Validate all input
- Use elxPrivate for sensitive data
- Implement proper access control
- Sanitize data before external calls
6. Maintainability
- Use descriptive names
- Document complex logic
- Keep chains focused
- Version control definitions
Integration Examples
Example 1: Leave Request
Components: - Form with leave details - Workflow with approval states - ETL for validation and notifications - Dataset for leave types
Flow: 1. Employee fills form 2. ETL validates leave balance 3. Workflow routes to manager 4. Manager approves in form 5. ETL updates calendar 6. Employee notified
Example 2: Customer Order
Components: - Form with order details - Dataset for products and pricing - ETL for inventory check - Workflow for fulfillment
Flow: 1. Customer selects products (dataset) 2. Prices calculated (ETL) 3. Order submitted 4. Inventory checked (ETL) 5. Workflow routes to fulfillment 6. Status updates in form
Example 3: Support Ticket
Components: - Form with issue details - Dataset for categories - Workflow for routing - ETL for SLA tracking
Flow: 1. User submits issue 2. Category selected (dataset) 3. Workflow routes to team 4. ETL tracks SLA 5. Updates visible in form 6. Notifications sent
Troubleshooting
Workflow Not Creating
Check: - Workflow State component configured - Workflow ID correct - User has permission
ETL Not Running
Check: - Chainset selected in form - Validation Endpoint present - User has permission to execute
Dataset Not Populating
Check: - Dataset query is valid - User has access to data - Component configured correctly
Data Not Saving
Check: - Validation passing - Field IDs correct - Database permissions - ETL processing correctly