On 10 Jan 2018, at 10:20, Robert Fleiser <fler...@gmail.com> wrote:HelloI'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 tostore 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.
--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/d81b7ada-06bb-4ce7-8b87-673ef8894ef6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello Maciej
Can you please validate/amend my understanding below on how to implement interaction between existing business application (BA) and jBPM in order to implement workflows:a) create some custom WorkItem handlers running on Workbench that remotely (RMI, ...) launch activity on business application based on some input parameters.b) deploy the jar with custom workflows in jbpm-console.war\WEB-INF\lib\ on Wildfly/Tomcat.c) create BPMN2 Process definitions containing these custom WorkItem handlers.d) BA launches a process with appropriate parameters, and also BA treats remote calls from custom WorkItem running on jBPM Workbench; BA is to provide adequate return values to continue the Workflow adequately.Some Node in Process would imply waiting an answer from outside world; it will be the responsability of BA to provide that answer to jBPM process using a REST call.This way I try to keep the whole business logic on existing BA, and all workflow chain related work delegated to jBPM.
Many thanks again, regards,Robert
--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/306b9cc2-6761-4118-8864-5a5b5e7507f5%40googlegroups.com.
On 17 Jan 2018, at 21:02, Robert Fleiser <fler...@gmail.com> wrote:Hi Maciej,I'm looking for a solution to access jBPM workflows from business application: be able to launch/abort workflows + query various informations about active/completed/aborted processInstances.At chapter 17 there are presented various REST ws listed (http://docs.jboss.org/jbpm/release/6.2.0.Final/jbpm-docs/html/ch17.html#remote.java.api), but I encountered some pbs/limits:1) there is an starting workflow example using RemoteRestRuntimeEngineFactory and that's fine, could start my processInstance in 2 ways:a) call 'kSession.startProcess(procName, params)' :....KieSession kSession = remoteRuntimeEngine.getKieSession();Map<String, Object> params = new HashMap<String, Object>(); params.put(.., ...);ProcessInstance processInstance = kSession.startProcess("Evaluation.dh1", params);b) using 'org.kie.remote.jaxb.gen.StartProcessCommand' as argument to: kSession.execute(command):....KieSession kSession = remoteRuntimeEngine.getKieSession();StartProcessCommand startProcessCommand = new StartProcessCommand();startProcessCommand.setProcessId("Evaluation.dh1");JaxbStringObjectPairArray jaxbParams=new JaxbStringObjectPairArray();jaxbParams.getItems().add(new JaxbStringObjectPair("RuleId", "1235"));startProcessCommand.setParameter(jaxbParams);ProcessInstance processInstance = kSession.execute(startProcessCommand);Note: I see that the kSession obtained from RemoteRestRuntimeEngineFactory is able to give information only on active ProcessInstances, so I'm loking to find another way to extract historical informations about processInstances (not Active):
2) I could get some limited informations about executed processInstances for those commands extending AuditCommand (FindVariableInstancesCommand, FindProcessInstancesCommand, etc) and being called this way:...KieSession kSession = remoteRuntimeEngine.getKieSession();kSession.execute(command);
3) Tried to call Rest services described in chapter 17 (http://docs.jboss.org/jbpm/release/6.2.0.Final/jbpm-docs/html/ch17.html#d0e14247) using HttpClient, but pbs encountered (see in attached txt file small code snippets and logs for 3 cases below):a)HttpClient POST call for process start (http://localhost:8080/jbpm-console/rest/runtime/org.jbpm:Evaluation:1.0/process/Evaluation.dh1/start) => no error thrown, processInstance is Completed, but the custom workItem handler didn't receive any input parameter.b)HttpClient GET call for a Completed processInstance variables (path indicated in mentioned link: [GET] /runtime/{deploymentId}/process/instance/{procInstId}/variables)Q: is there an error in my URL or calling code ?c) Use RemoteWebserviceClientBuilder/CommandWebService/JaxbCommandsRequest to call a ws: pb no '..CommandService?wsdl' available.
4) In 'http://mswiderski.blogspot.fr/2014/11/cross-framework-services-in-jbpm-62.html' there are presented jBPM services (org.jbpm.services.api.ProcessService, RuntimeDataService, UserTaskService, ..); pls lest me know how to make them available / how to call them from remote application ? are they intended to be used directly or indirectly ?
5) How to get the output results of various nodes of a processInstance ? using FindVariableInstancesCommand I extracted all the variables defined in a Process (or rather generated in a processInstance execution) - both input/output variables, but I wonder if there is a way to:->distinguish whether variable is input/output (don't seem to have such information in JaxbVariableInstanceLog).->have a view on parameters values as they were available for each particular node at processInstance runtime.
I attached the simple bpmn2 process definition in case it would be useful.Thanks, regards,Robert
--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/4b8a2296-f9d4-44d1-94e0-71302b0d2280%40googlegroups.com.
<3 code snippets with some logs.txt><dhRuleCaller.bpmn2>
Hi Maciej,
On 19 Jan 2018, at 20:50, Robert Fleiser <fler...@gmail.com> wrote:Hi Maciej,can I use jBPM API to read/parse a BPMN2 process definition file and extract in Java the whole process information (nodes/process parameters, nodes transition order, input/output parameters, etc) ?
AuditService (get from RemoteRuntimeEngine) can return information about processInstance's nodes, but it must have at least one processInstance executed - and I suppose it returns information only for visited nodes.
As indicated in link (https://groups.google.com/forum/#!searchin/jbpm-usage/DefinitionService|sort:date/jbpm-usage/R_iLYLd-6j8/Vw3C7JQUQ0UJ) the DefinitionService in jbpm-services-api.jar would retrieve that information inside an ProcessDefinition object.I saw also the method "RuntimeDataService.getProcessesByDeploymentIdProcessId" that returns that a ProcessDefinition based on deplID/procID.My application would need to read the processDefinition designed/deployed with jBPM Workbench; pls let me know how can I achieve this.
Without knowing if it is possible, I would see below scenarios:1) remote call to jBPM server (parameters: deployID, processID) ?2) if not, I could also consider 2 steps:a) call jBPM server to return the process BPMN2 text content, then:b) my application use some jBPM API to load BPMN2 text content in Java represenation ?
Along with your proposition could you pls give me a helping link or some small examples?
Meanwhile I plan to evolve my jBPM from 6.2.0 to 7.5 as you suggested, as in 7.5 the API must have been enriched.
Thanks, regards, Robert--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/a5a2cd0e-dd2f-40e9-b6fb-0d4f11da4542%40googlegroups.com.
Maciej,
--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/019ffa7e-6644-422a-bbaa-6ffdefebb14f%40googlegroups.com.
Thx for that link Maciej, I will use those WS to vizualize diagrams once I manage to work with 7.5.0 version ;)