Question on jBPM integration

874 views
Skip to first unread message

Robert Fleiser

unread,
Jan 10, 2018, 4:20:15 AM1/10/18
to jBPM Usage
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.

Maciej Swiderski

unread,
Jan 11, 2018, 4:25:51 AM1/11/18
to Robert Fleiser, jBPM Usage
Robert,

On 10 Jan 2018, at 10:20, Robert Fleiser <fler...@gmail.com> wrote:

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.
first of all 6.2 is reather old, latest released in 7.5 so I would recommend to look into it instead of 6 series that are no longer under development


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):
in general, process design is recommended to be done via graphical tools as workflows tends to be rather complex and use different BPMN2 constructs that might be difficult to express over api

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).
why would you do it? jBPM comes with dynamic model that can host number of versions of process definition, moreover with v7 case mgmt you can actually add nodes to running instance that do not exist in process definition

-(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.
there is so called fluent api to build processes via api but it’s not really complete and not maintained since version 5


2) Workflow execution:
-an user or some application entity (task, script, etc.) launches the workflow specifying some input parameters.
it’s there, in different ways, via api call, REST or JMS

-execution results (logs, errors) are available for further consultation.
by default all log data are stored in db

-display the status of pending/executed/executing workflows.
you can use workbench or custom apps to do that. Plus workbench comes with dashboards that can build graphs and charts to represent that data

-user is able to force stop of a pending or blocked workflow.
it’s called abort of process instance



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?
if it can display web page then it should be, but might be limited to what css/java script is supported that way

1.2) jBPM editor in web-client usage:
  a) can jBPM editor work in Tomcat rather than JBoss Wildfly?
in general yes, and there is workbench version for tomcat actually

  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) ?
this would require significant development

  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?
you use so called work items, see this article to learn more Integrate systems with processes - jBPM workitems

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?
yes

 
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?
don’t think that is possible

 
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?
best to utilize jbpm services Cross framework services in jBPM 6.2

 
2.2) eventually if some examples available on how can we use jBPM java API to obtain information concerning pending/finished workflows executions?
all is done through jbpm services, in the article there should be some base usage and an sample app available

Maciej
-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.

Robert Fleiser

unread,
Jan 15, 2018, 2:44:27 PM1/15/18
to jBPM Usage
Hello Maciej

thank you very much Marciej. I'll keep 6.2.0.Final for a while, until I'll understand how to use jBPM.

I'm trying to advance, and I'd ask you 2 new questions please.

I'd like to be able to remotely launch (from Eclipse) a Process containing a custom workItem run in Workbench, but unfortunately there is no parameter received by Process instance running on on Workbench.

Here are details on what I did (followed "21.Domain-specific Processes" chapter):
1) In an Eclipse project:
-I defined a custom workItem in a META-INF/**.wid file:
import org.drools.core.process.core.datatype.impl.type.StringDataType;
import org.drools.core.process.core.datatype.impl.type.ObjectDataType;
[
  [
    "name" : "DhRuleCaller",
    "description" : "Calls a rule",
    "version" : "1.0",
    "parameters" : [
    "RuleId" : new StringDataType(),
    "RuleName" : new StringDataType()
    ],
    "displayName" : "DH Rule Caller",
    "icon" : "icons/action.gif",
    "category" : "DH",
    "defaultHandler" : "com.sample.robert.workitemhandler.DhRuleCallerWorkItemHandler",
    "results" : [ 
        "Result" : new ObjectDataType("java.util.Map") 
    ]
  ]
]

-Java handler class (com.sample.robert.workitemhandler.DhRuleCallerWorkItemHandler):
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
// extract parameters
String ruleId = (String) workItem.getParameter("RuleId");
String ruleName = (String) workItem.getParameter("RuleName");

// do handler action:
System.out.println(getClass().getSimpleName() + " got called for ruleId="+ruleId+", and ruleName="+ruleName);

Map<String, Object> res = new HashMap<String, Object>();
res.put("Result", "Executed in DhRuleCallerWorkItemHandler!"); 

// notify manager that work item has been completed
manager.completeWorkItem(workItem.getId(), res);
}

-added reffered icon file in META-INF/icons directory.

-generated a jar with all these elements and manually add it in  jbpm-console.war\WEB-INF\lib.

2) Create a BPMN2 process containing only this new custom workitem handler and defined this way:
-DataInputSet with 2 elements: RuleId (DefinedTypes=Object) and RuleName (DefinedTypes=Object)-
-DataOutputSet: Result (DefinedTypes=Object)
-LanguageScript: Java
-Two Tasks:
       DataInput RuleId -> is mapped to RuleId
       DataInput RuleName -> is mapped to RuleName

Diagram properties:
-Adhoc = false
-Variables:
     RuleId :  java.lang.String (personalized type)
     RuleName :  java.lang.String (personalized type)

When I try to execute the process from Workbench, it displays this message:  * Automatically generated form, only supports simple text strings *
and then launches an instance. Log correctly displays: "(default task-61) DhRuleCallerWorkItemHandler got called for ruleId=, and ruleName=" because there's no parameter passed as argument. I intend to launch this process from remote application, with adequate parameters, without human tasks.

Above mentioned message (* Automatically generated form, only supports simple text strings *) tries to suggest some bad configuration with my Process definition?

Remote call - from Eclipse I tried 2 ways to run the Process using REST (each time the log show no parameter received):
1) using jBPM API, as indicated in chapter 17 (Remote API):
RemoteConfiguration remoteConfiguration = new RemoteConfiguration("org.jbpm:Evaluation:1.0", url, "krisv", "krisv", 3600);
remoteConfiguration.setServerBaseRestUrl(url);

RemoteRestRuntimeEngineFactory remoteRestRuntimeEngineFactory=new RemoteRestRuntimeEngineFactory(remoteConfiguration);
RemoteRuntimeEngine remoteRuntimeEngine = remoteRestRuntimeEngineFactory.newRuntimeEngine();
KieSession kSession = remoteRuntimeEngine.getKieSession();

Map<String, Object> params = new HashMap<String, Object>();
params.put("RuleId", "23");
params.put("RuleName", "My rule name");
ProcessInstance processInstance = kSession.startProcess("Evaluation.dh", params);

2) using httpclient call:
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
Credentials credentials = new UsernamePasswordCredentials("krisv", "krisv");
credentialsProvider.setCredentials(AuthScope.ANY, credentials);
HttpClient client = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).build();
HttpResponse response = client.execute(request);

String textView="";
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = "";
while ((line = rd.readLine()) != null) {
textView = textView + line;
}
System.out.println(textView);

Do you see why there is no parameter RuleId / RuleName received at custom workItem handler's execution if I remotely launch the process ?

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

Maciej Swiderski

unread,
Jan 16, 2018, 3:47:47 AM1/16/18
to Robert Fleiser, jBPM Usage
not really, that just means you haven’t created any form for your process definition, so if you’re not planning to use forms to launch your process you can ignore it
I suspect there is something wrong with data mapping so if you share the process definition we could take a look


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.
makes sense
in general, you can either embed jbpm into your application and consider it as another library or framework or use it as a service and call it either vie REST endpoints or JMS. that applies both ways, jbpm can call any other serivce with REST, WS JMS and more depending on used integrations.

Maciej

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.

Robert Fleiser

unread,
Jan 16, 2018, 5:27:56 AM1/16/18
to jBPM Usage
Hi,

I could finally solve my pbs with that process:
1) I didn't know that I have to Undeploy / Deploy a 'Deployement Unit' before Process changes take effect, so all my changes after saving the Process weren't taken into account by Workbench. I was wondering what's wrong on Workbench side, since the same BPMN2 definition worked well when loaded on Eclipse side).

2) Before being able to Undeploy the I had to manually delete process instances records in processinstancelog/processinstanceinfo for some badly created process instances (no processInstanceByteArray information in 'processinstanceinfo' table); I did so, being unable to Abort them from Workbench (cause of below NullPointerException):

WARN [org.drools.persistence.SingleSessionCommandService] (default task-29) Could not commit session: java.lang.NullPointerException at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106) [rt.jar:1.8.0_151] 
 at org.jbpm.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:159) [jbpm-persistence-jpa-6.2.0.Final.jar:6.2.0.Final] 
 at org.jbpm.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:150) [jbpm-persistence-jpa-6.2.0.Final.jar:6.2.0.Final] 
 at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:124) [jbpm-persistence-jpa-6.2.0.Final.jar:6.2.0.Final] 
 at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:274) [jbpm-flow-6.2.0.Final.jar:6.2.0.Final]

Thanks, regards, Robert

Robert Fleiser

unread,
Jan 17, 2018, 3:02:50 PM1/17/18
to jBPM Usage
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
3 code snippets with some logs.txt
dhRuleCaller.bpmn2

Maciej Swiderski

unread,
Jan 18, 2018, 3:14:52 AM1/18/18
to Robert Fleiser, jBPM Usage
Robert,

first of all, please consider to move to kie server api instead of kie-remote as kie-remote does not exist in v7 and thus whenever you decide to upgrade will require quite a refactoring. Moreover, kie server api has much more capabilities compared to kie-remote

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):
RemoteRuntimeEngine has getAuditService method that gives you access to history data 

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);
use audit service which should provide you bit more info


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.
it might be misconfiguration or simply limitation of kie-remote api


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 ?
services are the base for kie server remote api, meaning pretty much all services are exposes as REST/JMS in kie server so then you can leverage thier capabiltiies over remote invocation 


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.
this is only available for user tasks, that keeps record of input and output variables, all other node types don’t keep such info

Maciej

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.

For more options, visit https://groups.google.com/d/optout.
<3 code snippets with some logs.txt><dhRuleCaller.bpmn2>

Robert Fleiser

unread,
Jan 19, 2018, 2:50:14 PM1/19/18
to jBPM Usage
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

Maciej Swiderski

unread,
Jan 22, 2018, 2:27:25 AM1/22/18
to Robert Fleiser, jBPM Usage
Robert,

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) ?
as you already figured out, DefinitionService gives you some of these but not all, like transitions are not there.


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.
correct, it only returns data for instances that have been already started - it returns completed and active 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 ?
I would stick with number 1 as later is much more into internals of jbpm and that won’t be as simple as calling a method.


Along with your proposition could you pls give me a helping link or some small examples?
what kind of examples are you looking for?

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.
wise choice :)

Maciej

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.

Robert Fleiser

unread,
Jan 24, 2018, 2:46:22 PM1/24/18
to jBPM Usage
Maciej,

I've installed 7.5.0.Final version (from jbpm-installer-full-7.5.0.Final.zip), but some pbs:
1) the link 'http://localhost:8080/business-central' described in this version's documentation (http://docs.jboss.org/jbpm/release/7.5.0.Final/jbpm-docs/html_single/#_jbpmexamplesevaluation) is obsolete or something's wrong with my installation since that URL doesn't exist. Instead of calling directly standalone.bat as is indicated, I start the server with "start.jboss" ant target, and my Workbench url is rather:  http://localhost:8080/jbpm-console/kie-wb.jsp

2) logging with admin, krisv or other user I don't see some links that seem to be very basic (as described at the same link as above):
-Click Authoring ▸ Administration
-Click Repositories ▸ Clone repository
I 've attached the screenshot of my 'admin' options: workbench.png
I saw in Settings the option 'Artifact repository' but it seem not to be related to repository cloning; what could be wrong with my Workbench installation or usage?

3) Compared to my previous 6.2.0.Final version, I see that the 'Deployments' link doesn't display the deploy/undeploy options of projects. Instead it makes reference to Openshift. On this page it seems to require a Provider but I don't know what Master URL/username/password to specify.
It could be nice to put a small reference please on required Openshift configuration in online documentation of this version (http://docs.jboss.org/jbpm/release/7.5.0.Final/jbpm-docs/html_single).
(see attached deployments.png file)

4) I followed the steps specified on your blog (http://mswiderski.blogspot.fr/2015/09/unified-kie-execution-server-part-1.html) until the creation of one process instance, that I can see in 'Process instances' link, in status Active.
In order to see 'Hiring a Developerprocess definition or be able to launch a process instance from Workbench, I should have imported the related process definition from  'jbpm-playground'  link (https://github.com/kiegroup/jbpm-playground) but can't do it because there's no link (as per pb 2 explained above).
If I try to launch a process instance from Workbench (from available Process Definitions) I get this err message:
Unable to complete your request. The following exception occurred: No connection to 'default-kieserver' server(s). Server template configuration requires container 'hr' to be configured and started.

Any idea, please ?
Thx, regards
workbench.png
deployments.png

Robert Fleiser

unread,
Jan 25, 2018, 7:18:28 AM1/25/18
to jBPM Usage
Update for last message, 4th point - inside Workbench (in 'Executin Servers' page) I created/started a Kie container with specified GAV and thus could launch a ProcessInstance.
GAV: <group-id>org.jbpm</group-id>
<artifact-id>HR</artifact-id>
<version>1.0</version>

I'd like to have the HR project / diagrams imported among in my projects so as to be able to visualise process diagram, but which Repository URL to specify in 'Projects' / 'Import project' popup ?


Maciej Swiderski

unread,
Jan 26, 2018, 2:46:17 AM1/26/18
to Robert Fleiser, jBPM Usage
take a look at this article as it shows how to visiualize process diagrams with kie server


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.

Robert Fleiser

unread,
Jan 26, 2018, 4:25:30 PM1/26/18
to jBPM Usage
Thx for that link Maciej, I will use those WS to vizualize diagrams once I manage to work with 7.5.0 version ;)

For now I found troubles with version change:
1) I don't know what changes occured for custom workItem handlers between 6.2.0 and 7.5.0, but couldn't I couldn't use it. I tested using REST call through jBPM swagger interface, 2 workItem handlers defined in the same jar.

My dh-wkf-jbpm.jar gets deployed  in this directory:  ..wildfly-10.1.0.Final\standalone\tmp\vfs\deploymen\..\dh-wkf-jbpm.jar-a42346aa5dc0e1c0    from jbpm-console.war.
Jar structure:
\com/sample/.../DhRuleWorkItemHandler.class   and  DhTaskWorkItemHandler.class
\main\resources\META-INF\dh-wkf-jbpm.wid
\main\resources\META-INF\icons\ rule_lightbulb_on.png  and  task_alarmclock.png.

I copied the jar in jbpm-console.war\WEB-INF\lib\,  then update  jbpm-console.war\WEB-INF\classes\META-INF\CustomWorkItemHandlers.conf   to add my new workitems:
[
  "Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(),
  "WebService": new org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler(ksession),
  "Rest": new org.jbpm.process.workitem.rest.RESTWorkItemHandler(),
  "Service Task" : new org.jbpm.process.workitem.bpmn2.ServiceTaskHandler(ksession),
  "DhRuleDescriptor" : new com.sample.robert.workitemhandler.DhRuleWorkItemHandler(),
  "DhTaskDescriptor" : new com.sample.robert.workitemhandler.DhTaskWorkItemHandler()
]

Err: Caused by: org.drools.core.WorkItemHandlerNotFoundException: Could not find work item handler for DhRuleDescriptor
           at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.throwWorkItemNotFoundException(JPAWorkItemManager.java:77)
           at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:71)
           at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:140)
           at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:179)


2) Other pb comes with Workbench at Process design:
-created simple process Start->custom workitemhandlers->End,
-Click Save (of the diagram), then Save to deliver it in Git, then closing the diagram panel I get this popup message (showing it didn't really save):
    Business Process may contain unsaved changes or process validation is still running. Are you sure you would like to close the editor?

-If I click Ok to close it, I see that indeed no save was done:
>going back to process diagram, indeed I find only Start node.
>from Project level if I compile I'll get see below error in server.log saying there is no end node:
      ERROR [org.drools.compiler.kie.builder.impl.KieProject] (default task-35) Unable to build KieBaseModel:defaultKieBase
      [-1,-1]: Process '' [prj1.qqs]: Process has no end node.
      [-1,-1]: Process '' [prj1.qqs]: Node '' [1] Start has no outgoing connection.

Could it be some pb with git saving to not have process diagram saved?
Wonder if I should delete all niogit if something got wrong due to some outOfMemory errors I encountered at a certain moment...
Also, is there a way to delete a particular project (I didn't find a link for that, being connected with 'admin')?


3) hope you don't mind, I post again the first 3 questions posted on 24 Jan:
3.1) the link 'http://localhost:8080/business-central' appears in 7.5.0 version's documentation (http://docs.jboss.org/jbpm/release/7.5.0.Final/jbpm-docs/html_single/#_jbpmexamplesevaluation) and I wonder if it's an old link, or something's wrong with my install since that URL doesn't exist. I installed jBPM from jbpm-installer-full-7.5.0.Final.zipstarted the server with "start.jboss" ant target, my Workbench url being:  http://localhost:8080/jbpm-console/kie-wb.jsp

3.2) logging with admin, krisv or other user I don't see some links that seem to be very basic (as described at the same link as above):
-Click Authoring ▸ Administration
-Click Repositories ▸ Clone repository
I 've attached the screenshot of my 'admin' options: workbench.png
I saw in Settings the option 'Artifact repository' but it seem not to be related to repository cloning; what could be wrong with my Workbench installation or usage?

3.3) Compared to my previous 6.2.0.Final version, I see that the 'Deployments' link doesn't display the deploy/undeploy options of projects. Instead it makes reference to Openshift. On this page it seems to require a Provider but I don't know what Master URL/username/password to specify.
It could be nice to put a small reference please on required Openshift configuration in online documentation of this version (http://docs.jboss.org/jbpm/release/7.5.0.Final/jbpm-docs/html_single).
(see attached deployments.png file)

Regards
Reply all
Reply to author
Forward
0 new messages