Workflows and Process Management (Forms Workflow, OSGi Services)
Forms Workflow on OSGi
AEM Forms Workflow uses AEM workflow models with Forms-specific steps: Assign Task (forms-centric), Submit to FDM, Generate Document of Record, and Document Services steps. Understand the Forms Workflow submit action, task assignment to users/groups, and how form data flows between steps via workflow metadata and payload.
OSGi services and processes
Custom logic is packaged as OSGi services and invoked from workflow steps (Process Step, Workflow Process). Know service registration, SCR annotations, and how to reference services from workflow components. Also know the difference between workflow variables/metadata and the payload, and how data is persisted between steps.
Traps
- Assuming form data is automatically available to later steps; it must be mapped into metadata or payload.
- Confusing AEM workflow (Sites) with Forms Workflow task semantics.
- Forgetting that custom OSGi services must be active and their dependencies satisfied.
- Overlooking task assignment and ACL implications for assignees.
Worked example
A leave-request form submits to Forms Workflow. Step 1 assigns a task to the manager group; step 2 calls a custom OSGi service to compute balance; step 3 generates a Document of Record. The trap: the custom service needs the submitted data, which must be explicitly mapped from form data into workflow metadata before the process step reads it.