Hi,
I'm exploring the possibilities of using an ABAP object to function as Workflow Data Container.
The use case is to:
1. Have a workflow triggering report program (Y_TEST1) with 2 parameters at selection screen: P_NUM1 and P_NUM2.
2. Have an ABAP object with 3 attributes: Key ID, Num1, and Num2 in program Y_TEST1.
3. Instantiate ABAP object in Y_TEST1 and set P_NUM1 to Num1, P_NUM2 to Num2.
4. Have a Workflow Template (Y_TEST2) having only 1 step - A user decision task. The title displays "Test 1 &1, Test 2 &2". The 2 parameters are Num1 and Num2 from the ABAP object. Task agent to be set as Workflow Initiator for simplicity.
5. Trigger Workflow by Event or Function Module, and pass the ABAP object as the only exporting element from Y_TEST1 to Workflow.
6. The ABAP object should persist from Y_TEST1 to Y_TEST2, so that P_NUM1 and P_NUM2 input from Y_TEST1 should be displayed in user decision task.
The above use case is a simplified version. In reality, Num1 and Num2 could be a derived attribute based on processing logic in Y_TEST1 and they are required in the workflow for multiple level business decision making.
I have read through Jocelyn Dart's blog posts on using ABAP Class with Workflow, and I find difficulties in incorporating the methods to my use case.
Difficulties:
1. Should I instantiate the ABAP object in Y_TEST1 using Constructor method or BI_PERSISTENT~FIND_BY_LPOR?
2. No matter how I instantiate the ABAP object in Y_TEST1 and trigger workflow using CL_SWF_EVT_EVENT=>RAISE, the event object is still null when it reaches the user decision task. Why is that so?
3. How should I pass the ABAP object instantiated in Y_TEST1 into workflow Y_TEST2, so that Num1 and Num2 value would persist in the user decision task in Y_TEST2?
Your insights and suggestion would be much appreciated.
Regards,
WONG Kuan Lung