I'm trying to invoke a jbpm process with a custom object process variable via remote client against kie server.
The process does some updates on the process variable which I need to retrieve back.
What's the best way to retrieve the modified process variable?
Appreciate any examples along with answer.
[6.5.0 final]
If process instance is completed then you can use below REST API's to get process variable info
[GET] http://localhost:8080/kie-server/services/rest/server/queries/processes/instances/{ProcessInstanceID}/variables/instances
[GET] http://localhost:8080/kie-server/services/rest/server/queries/processes/instances/{ProcessInstanceID}?withVars=true
If process instance is active then you can use below REST API:
http://localhost:8080/kie-server/services/rest/server/containers/{containerId}/processes/instances/{ProcessInstanceId}/variables
Related
in JBPM is possible to expose a custom REST Service in order to close custom task?
in the example below the process must wait a REST call from an external application in order to close the process.
How I can implement this requirement in JBPM 7.31?
If you remove manager.completeWorkItem(workItem.getId(), results); from RESTWorkItemHandler process execution will wait for completion of REST task. You can manually complete this task through kie-server REST API
[PUT] /server/containers/{containerId}/processes/instances/{processInstanceId}/workitems/{workItemId}/completed
Inplace of making REST task wait I will suggest to add Intermediate timer node or Intermediate Signal node inplace of REST task.
having a signal or receive task would make more sense here instead of creating Url for each process instance to complete. you can provide your implementation of the receive task i.e. a generic service that completes your task. or a signal that you can trigger when your custom rest service is invoked.
Is there a way to check whether all the messages/flow-files in a processor group has cleared or not using rest api in shell script?
Basically, my use case is that I am stopping a nifi processor in my shell script via curl command. Then I need to wait till all the queues are empty and flow files have passed through before proceeding further.
Yes, you can query the status of individual connections or the process group status via the API. The easiest way to do this is perform the action in your browser and use the Developer Tools to monitor the request and copy/paste this to your invoking tool.
I want to have my application already started on my YARN cluster and allow the users to send additional commands. I am still in the design phase, but I'm confused on the best way about going about this. Is this possible? Could the user send some sort of REST command to the Application Master or Resource Manager that could then be passed to the running YARN Application?
You can if you're willing to build a custom AM and write your own REST API but writing a custom AM is not trivial. As for the RM, you can kill your application or move to another queue via REST API calls but not much else.
https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html
I need to create a task, as in start an instance of a human task, so it appears in the My Tasks list. Is this even possible without having it linked to a process instance? It's just that I only need the Human Task processor as I'm using another program to handle the process. So in my other program it'll go through the workflow and then when it reaches a user task it creates the task in WSO2 BPS so it can be completed.
I'm using generated stubs in Eclipse for the SOAP requests.
This is supported. Just invoke Task service as normal web service using stubs (wsdl2java) or any other way (like SOAPUI). It will create a Humantask.
I'm trying to achieve following scenario
When a new message arrives to queue manager it should automatically trigger my console application. Then it will fetch that message and write the message in to a file. I already completed this part. But I'm having problem with triggering message queue
Here is how I configured my message queue
I created two queues one is called LocalQueue and other one is InitQueue which is SYSTEM.DEFAULT.INITIATION.QUEUE.
and set "Trigger" properties in my LocalQueue
Then Created trigger monitor
In process definition object I set my console application path
So my problem is, It doesn't work as it expect and I checked my client machine
C:\Program Files (x86)\IBM\WebSphere MQ\errors\AMQERR01.LOG and server machine C:\Program Files (x86)\IBM\WebSphere MQ\errors log files. I couldn't find anything on them
Update
Based on Morag answer I changed my process name
You appear to have named your TriggerMonitor Service object in the queue attribute where you should put the process object name FetchMessages.
The Start Args for your trigger monitor Service object appears to be telling the trigger monitor to monitor the LocalQueue and not the InitQueue.
You need to make sure that the trigger monitor is running and has opened the initiation queue in INPUT(i.e. for GET) mode. Only then queue manager will put a trigger message into initiation queue. Here is what I did to get it working:
I did the setup just like you except for service. I manually started runmqtmc as
SET MQSERVER=<channel name>/TCP/<connname>
runmqtmc -m <qmname> -q <initq>
Put a test message on local queue. That triggered an event and my application started.