Its very simple to create a cobol program that starts a processflow, and nothing else. I often do that to create lookup/email/extract flows and give the users access to running a pflow.
You have to be able to:
1)write cobol
2)add processflow service in pflow admin
3)tie the service to a flow
4)have access to pflow designer and create the pflowrun and or final flow.
cobol pd:
000300******************************************************************
050-EDIT-PARAMETERS SECTION 10.
GO TO 050-END.
050-END.
EXIT.
000400******************************************************************
000500 100-PROGRAM-CONTROL SECTION 10.
000600******************************************************************
DISPLAY "PROGRAM BEGINS".
PERFORM 1000-OPEN-WORKFLOW-DB.
MOVE "FLOWRUN" TO CRT-TOKEN.
MOVE "UPDATE" TO WFAPI-I-VARIABLE-NAME (1).
MOVE PRM-INPUTPARAM TO WFAPI-I-VARIABLE-VAL (1).
MOVE "EMAILTO" TO WFAPI-I-VARIABLE-NAME (2).
MOVE PRM-INPUTEMAIL TO WFAPI-I-VARIABLE-VAL (2).
MOVE "FLOWNAME" TO WFAPI-I-VARIABLE-NAME(3).
MOVE PRM-INPUTFLOW TO WFAPI-I-VARIABLE-VAL (3).
PERFORM 1000-PROCESS-FLOW.
DISPLAY "PFLOW RETURN MSG -" WFAPI-O-RET-MSG.
001500 DISPLAY "PROGRAM ENDS".
GO TO 900-DONE.
01700 100-END.
EXIT.
***************************************************************
900-DONE.
EXIT.
This batch program starts a service called 'flowrun'. Service must be defined with an underscore after the name - flowrun_
Service must also be tied to a processflow, also called flowrun.
It passes flowrun 3 parameters. Update flag, email address to send results to, pflow number to run. Options are 1,2,3
Service flowrun starts up. It receives the pflow number to run. if 1 it async runs flow1, if 2 it async runs flow 2. if 3 it async runs flow 3.
If you choose to, flowrun can just singly run the final flow you need without the multiple choice option. I just wanted an easy way to run multiple flows from a single program.
So you don't touch PR140, you just ADD another batch program in the job stream.
You can also create an end user exit for PR140 that will accomplish the same function.
Questions welcome.