Hello
 
I'm trying to understand how to use/integrate jBPM core (version 6.2.Final) inside an existing client/server application in order to create/execute workflows with existing application's business objects and actions.
 
I’ve done some google search and read some jBPM 6.2 documentation but would need the opinion of some experienced developer to be sure jBPM solution could fit the requirements for integration in our application, and also some tips how to do it.
 
Desired workflow behavior (no need for user tasks in the 1st step):
1) Workflow definition: user creates/edits the workflow using various custom actions (existing application’s tasks, scripts, import/export procedures, etc.), then for each action:
-choose its type (preferably from a list), then
-choose specific action’s name/ID (preferably from a list returned by a call to our application), then provide execution parameters (names-value pairs, or an ordered parameters list).
-validates/saves the workflow in BPMN2 xml format; if possible, the saving action would be performed by our application (in DB or file on disk).
-be able to parse BPMN2 xml file using jBPM and extract workflow information (the actions definition/ordering) in order to
store it in our DB (in a data model that refers the actions implementation, stored in our DB).
-(less important, in case it is possible) be able to regenerate existing BPMN2 using jBPM java API for minor changes (ie change one parameter value or add a new parameter for the 3rd action in the workflow). This would suppose jBPM java API loads a BPMN2 xml workflow definition, search for a particular action number (or ID), performs some changes in action definition and save back the workflow in BPMN2 xml format.
 
2) Workflow execution:
-an user or some application entity (task, script, etc.) launches the workflow specifying some input parameters.
-execution results (logs, errors) are available for further consultation.
-display the status of pending/executed/executing workflows.
-user is able to force stop of a pending or blocked workflow.
 
 
I’d like to achieve the integration of jBPM editor/running core - with the least impact on actual application (if possible no Jboss Wildfly, no business object redefinition in jBPM editor, etc.).
 
 
Questions about jBPM integration:

1) Workflow definition (concerning jBPM graphical BPMN2 editor):
1.1) can the editor be called (via some API) and displayed in a swing panel?
1.2) jBPM editor in web-client usage:
  a) can jBPM editor work in Tomcat rather than JBoss Wildfly?
  b) can jBPM editor be used in a simplified manner, without maven/git usage (we have already an audit trail system for all objects, and there should be only one user to edit a workflow, no need for git support) ?
  c) how to model inside jBPM editor custom actions as described above: selecting data from our application (action types, name/ID, parameters) to make it available to actions calling application’s services?
What kind of Object to be chosen from ‘Objects Library’? Can I or shall I define some custom object kind in ‘Objects Library’?
Shall I define ‘Work Item definition’ for custom actions inside jBPM editor and/or in java implementing the WorkItemHandler interface?
 
1.3) Let’s say before workflow creation/edit it must be called:
- ‘org.mycompany.services.DataRetrieveService.getWkfActions()’ service to get the available actions types in my application (task, script, etc) – to feed available actions inside the editor,
- ‘org.mycompany.services.DataRetrieveService.getTaskData(…)’ service to get the available application’s tasks ids/names – to feed concrete task s inside the editor.
How can I perform such calls at editor opening, making this data available in particular actions available for workflow editor in ‘Object library’ or workflow’s existing actions?
 
2) Workflow execution:
2.1) how would you propose to launch the workflow through API, without using web client – would like to launch it from our application – an user or some application entity (task, script, etc) ?
In jbpm-examples project we can see different examples of starting workflow execution with its name/input parameters using ksession.startProcess method, followed by manager.disposeRuntimeEngine(runtime) at the end – is this the expected way to launch the workflow without web-interface?
 
2.2) eventually if some examples available on how can we use jBPM java API to obtain information concerning pending/finished workflows executions?
-intermediate action’s status,
-execution input/output parameters,
-last executed action, since when the current action is stuck for pending workflow executions.
 
Thanks, regards, Robert F.