Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#825564
Hi,
I want to pass user input(text field) to a trigger to check with database and see if the user input is in database or not and return the related user input values.
But I can't find any related topic about it.
I also tried to set a case variable for trigger to use, but setting variables need PM_CASES permission which i can't have it for operator users.
Please help me.

Thanks in advance
Last edited by ehsanv on Thu Jul 25, 2019 5:05 am, edited 1 time in total.
#825569
The PROCESSMAKER_OPERATOR role has the PM_CASES permission. An Operator can't see any cases without the PM_CASES permission. Are you thinking of another permission?

How are you executing your trigger? If you are using REST or the executeTrigger() web service, ProcessMaker will check whether the logged-in user is assigned to the task (indicated by the delegation index) in the case.

ProcessMaker doesn't provide a way to pass arguments to a trigger. What you have to do is set variables in the case and then have your trigger code use those case variables. Then you can unset those variables in the case if you don't want them to remain.

If you install the extraRest plugin, there is a REST endpoint that allows you to set variables, execute the trigger and then unset the variables in one operation.
See:
PUT http://{domain-or-ip}/api/1.0/{workspace}/extrarest/case/{app_uid}/execute-trigger/{tri_uid}

That endpoint also allows you to get around the security restrictions that are probably causing your problem.
#825589
I'm using javascript and REST API. I used Value Based Assigment for tasks and the value is @@USER_LOGGED because i wanted the user who started the case do the whole case.
About PM_CASES you are right! But i don't know why I can't set variables, this is my code:
Code: Select all
$.ajax({url:host+'/api/1.0/'+ws+'/cases/'+caseID+'/variable', data:{'strBuffer':this.value}, type:'PUT'});
My case variable name is strBuffer and i wanted to set it my value and used it in trigger.

finally about extraRest, I used it and worked! Thanks!
Task doesnt have any users.

The first problem is that you need to use = = in[…]

Just guide me to implement this?

Hi, I have a text control (rfq_segment) and I wan[…]

Genial!!! gracias. :D i need to translate an[…]