How to find who claimed a task in Process Portal? - ibm-bpm

We have a task that was created in IBM BPM and assigned to a Group.
In case someone from my Group has claimed it, how do I find which user of the group claimed the task?
Thanks,
Bharath

You may use Process Inspector application at /ProcessInspector with a user with administrative privileges.
You may search for and locate your process instance, and then locate the task you're interested in at details panel at the right-hand side. If the task is not yet claimed, you'll see the group name here, or if it's claimed by someone in that group you'll see that user's name.

You can get this info from the REST APIs. If you know the Process ID you can use the task summary REST API: http://host_name:port_number/rest/bpm/wle/v1/process/<process_id>/taskSummary/
Or if you know the Task ID you can use the Task Details REST API: http://host_name:port_number/rest/bpm/wle/v1/task/<task_id>?parts=all
You can test using the IBM BPM REST Test Tool: http://host_name:port_number/bpmrest-ui

Related

IBM BPM 8.5.6 Suspend task

Is it possible to suspend a task via process portal in IBM BPM 8.5.6. In the 6.2 version we were able to do this via inbox or saved searches. However the new saved searches doesn't support this? Is there a way to do this?
In v8.5 there is nothing like suspending a task from process portal. Although we can suspend a task from Admin Console .
Moreover if you want to suspend it from process portal , you can try the below way:
create a HS , having a text box for accepting PID of the process.
Use JS API , to suspend the Task for the provided PID.
var id = tw.local.pid ;
tw.system.findProcessInstanceByID(id).suspend() ;
Expose this human service as a Startable Service to the intented users.
provide the PID which you want to suspend .
As Jyoti Yadav already stated, you can suspend a task via Javascript API.
An alternate way would be using the /ProcessAdmin page. After logging in you choose the tab "Process Inspector" from the top of the page and search for your instances:
This would be a less flexible, but more human approachable way of suspending a task.
You can not suspend a task, you can suspend the instance.
This is OK if all tasks are sequential, but what if you have parallel tasks and you want to suspend only one of them.
A great alternative that i used is:
assign that task to the system user (bpmadmin, wasadmin, celladmin, deadmin,.... whatever you named it), then your instance is still active but it can not be completed until you reassign it back to a user and it finishes it.
This way you can create tasks now, and with a timer you can assign them to a user/group at a specified time.
The code i used:
tw.system.findTaskByID("123456").reassignTo("bpmadmin");
to assign it to the system user so no one can see it,
then in the timer script:
tw.system.findTaskByID("123456").reassignBackToRole();
to assign it back to the group to be executed.
You can either suspend them through the Process Inspector or via REST Api calls that BPM provides. URL can be :
https://baseroot:9443/bpmrest-ui/BPMRestAPITester/index.jsp
In answer to the follow up question, you can put it in the administration portal by exposing it as an "administration service" instead of a "human service".
https://ip:port/rest/bpm/wle/v1/process/xx?action=suspend&parts=all (put)
and
https://ip:port/rest/bpm/wle/v1/task?action=cancel&taskIDs=? (put)
You can refer to the API document of V 8.5.6 for task suspension and then use your own task ID to drop the API suspension task

How to get test agent's state and queue length

does a codedui tests agent exposes an api to get information
about it's status in real time?
if so where can i find details about it and purhapse code examples?
edit:
i've found a way to get some information on test agent via command line (link in the comment section),
still would love to know id there's an api to enable other types or actions, specifically restarting the agent
Looks like there is a lot of functionality to be accessed through TestAgentConfig.exe. I found an MSDN blog post that goes into some details on the feature.
Specifically, to start or stop the agent: "Start/Stop service - sc \machinename stop vsttagent ; sc \machinename start vsttcontroller. If the agent and controller are in different domain, you can use IP instead of machine name."

How to get the user who initiated the process in IBM BPM 8.5?

How to get the user who initiated the process in IBM BPM 8.5. I want to reassign my task to the user who actually initiated the process. How it can be achieved in IBM BPM?
There are several ways to get that who initiated a Task , But who initiated a process Instance is somewhat different.
You can perform one out of the following :
Add a private variable and assign it tw.system.user_loginName at the POST of start. you can access that variable for user who initiated the process.(It will be null or undefined for the scenario if task is initiated by some REST API or UCA.)
Place a Tracking group after Start event . Add a input variable to it as username , assign it a value same as tw.system.user_loginName. So whenever Process is started entry will be inserted to DB Table.You can retrieve this value from that view in PerformanceDB.
Also there might be some table ,logging the process Instances details , where you can find the user_id directly.
I suggest you to look in getStarter() method of ProcessInstanceData API.
Official Documentation on API
This link on IBM Developerworks should help you too: Process Starter
Unfortunately there's not an Out Of The Box way to do this - nothing is recorded in the Process Instance that indicates "who" started a process. I presume this is because there are many ways to launch a process instance - from the Portal, via a Message Event, from an API call, etc.
Perhaps the best way to handle this is to add a required Input parameter to your BPD, and supply "who" started the process when you launch it. Unfortunately you can't supply any inputs from the OOTB Portal "New", but you can easilty build your own "launcher".
If you want to route the first task in process to the user that started the process the easiest approach is to simply put the start point in the lane, and on the activity select routing to "Last User In Lane". This will take care of the use case for you without requiring that you do the book keeping to track the user.
Its been a while since I've implemented this, so I can't remember if it will work elegantly if you have system steps before the first task, but this can easily be handled by moving the system steps into the human service to be executed as part of that call, rather than as a separate step in the BPD.
Define variable as string type and using script task to define the login user that use this task and assign it to your defined variable to keep to you in all of the process as initiator of the task.
You can use this line of code to achieve the same:
tw.system.user_loginName

can i get more granular ami events for app_fax?

When sending a fax using spandsp/asterisk/app_fax, it would really be nice to see more granular status events being fired.
Right now, it just looks like AMI events are fired when the call is started and when the call finishes. I'm looking to get more detailed info like "DIALING", "SENDING PAGE 1", etc.
Is there a way (either using the AMI or another method) to get this information?
I know it definitely exists somewhere, as I can see DEBUG statements with this information in the logs. I can't (and don't want to) parse the log files, as the DEBUG statements don't really say which call they relate to.
Thanks!
no
but nojee fax project did special patch for app_fax.c to give more verbosity.
probably u can create patch for app_fax.c to show needed info.

Initiate an outgoing call with Asterisk

I have a database where one entry is structured like so:
number_to_call date file_to_play
Using asterisk, I need to do the following:
1. Check the database daily.
2. If date matches that of today's, then initiate call on number.
3. Once phone has been picked up, play file_to_play.
Some general pointers on how I even begin to do this would be great.
Most of the applications that I have written so far have worked on incoming calls. I have the following questions:
1. How do I write a "daemon" that will check the database? Asterisk should have both user and group privileges for it to execute properly. How do I do this?
2. Can I initiate an outgoing call from outside of the asterisk dialplan?
The calls are being made to a PSTN/mobile number.
You can Write any script Which can check DB on daily basis and once it maches the date range you can initiate a call using .call files.
Please study asterisk auto-dial out from voip-info.org - I think you can understand better then.
You can run your script for same user as asterisk runs there is also one more method to initiate call from linux which we can call Originate CLI command which can also refer to http://voip-info.org/.
In general it is not a great idea to write your own dialer, unless your volume is very very low. Where I work, we started rolling our own but at the end went with a commercial solution that handled most of the logic. There are a number of commercial and free solutions out there, so don't reinvent the wheel.
See my answer to https://stackoverflow.com/questions/11666755/outbound-dialer-using-asterisk/14589901#14589901 for why it is not a good idea to roll your own.

Resources