Per PRODMGT-336, please make allowances in BPM to allow the user to search process instances for arbitrary process variables. Access should be RESTfull.
Please note that this BZ is public, the customer wishes to track it. Rick
Initial designs for this functionality suggested the following: -Add a method that will allow users to search process instances based on variable value. -For basic types (String, Integer, etc) it will work immediately -For complex types, 'toString' should be implemented in a way that will facilitate the search Thanks, Rick
Additional customer feedback as we work on this RFE/BZ. If possible, they would like to retreive image data via REST as such: http://localhost:8080/business-central-server/rs/process/definition/{id}/image/{instance} Thanks, Rick
This certainly a good API to expose. But given the schedule impact we punt this out to post 6.0
Marco, can this one be closed based on what's there currently already?
This has been added to the REST api for BPMS: 6.0.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/9f72787 master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/9f72787
I've added the following rest operations: /rest/history/variable/{variable-id} /rest/history/variable/{variable-id}/value/{variable-value} /rest/history/variable/{variable-id}/instances /rest/history/variable/{variable-id}/value/{variable-value}/instances The first 2 operations simply return the list of (JAXB/JSON) VariableInstanceLog instances. These instances contain, among other information, the id of the process instance. The second 2 operations return the list of process instances (by first retrieving the list of variable instance logs and then retrieving the process instances based on the process instance id field in the variable instance logs). --- With regards to retrieving the image data, I'm not sure I'll have time to do that before the release. I'm doing my best, but can't promise anything.
Rick, FYI: This feature has been added to the REST api: -Add a method that will allow users to search process instances based on variable value. -For basic types (String, Integer, etc) it will work immediately For the time being, see: https://github.com/droolsjbpm/droolsjbpm-integration/wiki/Rest-API#history-variable-operations That documentation will eventually be added to both product and community docs.
I've tested this with ER7 and written several tests for this feature, see: http://git.app.eng.bos.redhat.com/jbossqe/brms.git/tree/test-jbpm-integration/src/test/java/org/jboss/qa/bpms/jbpm/integration/remote/VariableHistoryTest.java However none of them work. 1.) I cannot work with variables correctly. String values are somehow converted to Long and I don't know why: parameters.put("var1", "30"); produces: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String Starting the process from business-central manually works well. 2.) In other case JaxbHistoryLogList contains empty internal historyLogList, no variable "myobject" found in the log. 3.) I've also encountered this error: org.jboss.resteasy.plugins.providers.jaxb.JAXBUnmarshalException: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"process-instance-list"). // Expected elements are <{}log-instance-list>,<{}node-instance-log>,<{}process-instance-log>,<{}variable-instance-log> All errors are commented in corresponding test methods, which reproduce them. To reproduce issues listed above: 1.) Download BPMS 6 ER7 (eap6) and setup a db (in my case PostgreSQL). 2.) Add user ibek: ibek=9143dd65119c7b733e02c5076dcf8f84 (into application-users.properties) ibek=admin (into application-roles.properties) 3.) Run the server. 4.) Run the tests: git clone git://git.app.eng.bos.redhat.com/jbossqe/brms.git cd brms mvn clean test -Pjbpm-integration -Dtest=VariableHistoryTest (it will install test projects from bpms-assets.git automatically). I think this should be fixed, as this was requested by a customer.
Fixed. Commits: 6.0.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/8fc68a88 master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/07487cd4
Fully fixed.. Commits: 6.0.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/8fc68a88 https://github.com/droolsjbpm/droolsjbpm-integration/commit/8d8466fe master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/07487cd4 https://github.com/droolsjbpm/droolsjbpm-integration/commit/82275228
This no longer has a target release of 6.0.0.
Verified in BPMS 6.0.1.ER1 Filed issues: BZ 1069568, BZ 1069622