Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a module record from a workflow via webservice
#1
Okay, I took a look at the following files:

https://github.com/tsolucio/corebos/blob/master/modules/com_vtiger_workflow/tasks/VTCreateEventTask.inc

and

https://github.com/tsolucio/corebos/blob/master/build/HelperScripts/importcsv.php

My goal is to make my module (that basically relies on the use of workflows) create a record for each workflow execution to show the result. The result will be a server answer, since it is connecting to a foreign application. Since I know very little about the vTiger/coreBOS webservice, I thought I'd start a topic here that will maybe help others as well.

My starting point is a line in the file in the second link:

PHP Code:
$row vtws_create('Accounts'$row$current_user); 

This is from this line. I presume this is a function from 'include/Webservices/Create.php' that handles the actual creation of a record. I will need to take a look at that function to find out more.

I also studied the class definition in the include file that creates an event, I know the 'doTask' method is the one that is actually executed when the workflow condition is met. I now have very simple custom functions in a single file that handle the API calls to the foreign server, and I'd basically like to expand them with a method from an existing class (the 'vtws_create' command?) that creates a record with the return from the foreign server. I can only get the answer from the server from the same function as I use to send data, so whatever I use, it can't be a separate workflow.

The above may be a little confusing, since I studied a lot of files but don't really get the context yet. In the end, I just want to create a new row in the main table of my module, but do it in a system-accepted way, so all other related actions are also taken (like updating the crmentity table). So can I use the 'vtws_create' function? Will it take care of all other system-updates for me? Does it expect any special parameters? Do I need to include special files (other that the 'include/Webservices/Create.php')?
Reply


Messages In This Thread
Creating a module record from a workflow via webservice - Guido1982 - 12-15-2015, 01:50 PM

Forum Jump:


Users browsing this thread: 7 Guest(s)