hazey
September 17, 2018, 11:17am
1
Hello,
I’m creating custom grid with a list of my requests/actions using GraphQL API.
I’d like to know how to generate link to quick actions (Yes,No,Modify) - just like in this topic:
WorkflowGen’s Quick Mass Approval feature lets you easily and quickly handle multiple approval requests at once, using buttons such as Yes, No, or Modify as enabled and defined by the process designer.
[quick_mass_approval-1-1024x608(1)]
To use Quick Mass Approval:
Go to the Search screen by clicking Search on your Workflow Portal home page or in the banner menu.
On the Search screen, click Actions to perform an actions search and display the available options.
Quick Mass Approval is …
Is it possible? It would be also nice to have additional field with boolean flag that I tells to show or not this links (like “CanCancel” field).
Regards
Hi @hazey ,
We do not support this as a standard feature unless you would like to do some custom development.
The easiest approach for your solution is to use a DropDownList which indicates Yes, No or Modify.
And in code behind, you can use the RowDataBound property in order to hide or display the desired columns.
Regards,
Eddy.
hazey
September 17, 2018, 2:56pm
3
Thanks @eddy.daouk for your reply.
I dived more deeply into that solution, and I’ve figured out that every ‘action’ button calls JavaScript function called
quickApprovalFunc
with specific parameters.
This function makes an http request to
api.asmx/CompleteWebFormActivityInstance
with speficic Form data (processInstanceId + activityInstanceId + workflowContext).
(my workflow context):
{
"NewDataSet": {
"parameter": [
{
"name": "APPROVAL_DECISION",
"dataType": "TEXT",
"direction": "OUT",
"textValue": "YES"
}
]
}
}
I assume that I could use
completeAction
mutation method from GraphQL API instead of old WebService.
But what condition do I have to base on in order to enable/disable visibility of these buttons? Is this flag:
canComplete
enough?
Hi @hazey ,
Yes, you can use Action.canComplete to validate if the user has permissions to complete the action.
Regards,
Eddy.
hazey
September 17, 2018, 4:05pm
5
The field I was looking for is called hasQuickApproval
.
Example request:
{
viewer {
requests {
items {
number
actions {
items {
number
canComplete
activity {
hasQuickApproval
}
}
}
}
}
}
}
Example response:
{
"data": {
"viewer": {
"requests": {
"items": [
{
"number": 1,
"actions": {
"items": [
{
"number": 1,
"canComplete": false,
"activity": {
"hasQuickApproval": false
}
},
{
"number": 2,
"canComplete": true,
"activity": {
"hasQuickApproval": true
}
}
]
}
}
]
}
}
}
}
The proper condition to view these “Quick approval” buttons you have to combine:
canComplete == true && activity.hasQuickApproval == true
This topic can be closed.