I am getting following error. Any help is appreciated
EXCEPTION_THROWN|[12]|System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []
Approval process can only be defined on Opportunity, not on its line items.
You cannot define any approval processes through code, rather you can use them to submit your request from code.