Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I don't understand the 'getFieldNames()' function in the workflow tasks
#2
This is special functionality that the workflow tasks give you. Simply defining that array of variables makes them available to your task. Once you add the variable name to the array it will be saved in the database when saving the task and retrieved automatically for it to be read when executing the task.

The idea is that your task will need variables to permit the user to configure it and then when it is executed they will be read so the task can perform whatever it has to do. The workflow system takes care of the dirty details for you, just define the array and the variables will be magically saved and retrieved.

For example, in https://github.com/tsolucio/corebos/blob/master/modules/com_vtiger_workflow/tasks/CBTagTask.inc#L26
The task defines three variables:
'listoftags': comma separated list of labels
'addrel': boolean to indicate if the task should add or remove the labels
'forallusers': boolean to indicate if the action will apply to all users or just the current user

once that is defined you can create an form with three widgets, one for each variable with those exact names like here:

https://github.com/tsolucio/corebos/blob/master/Smarty/templates/com_vtiger_workflow/taskforms/CBTagTask.tpl#L25

and the variables will be saved and then retrieved on execution
Joe
TSolucio
Reply


Messages In This Thread
RE: I don't understand the 'getFieldNames()' function in the workflow tasks - joebordes - 11-24-2015, 09:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)