bizproc.robot.add
This method registers new automation rule.
Parameters
Parameter | Description |
---|---|
CODE | Automation rule internal ID. Permissible symbols are a-z, A-Z, 0-9, period, hyphen and underscore. Required parameter. |
HANDLER | Application URL, to send data. Required parameter. |
AUTH_USER_ID | ID of the user, token of which will be passed to the application. |
NAME | Name of automation rule. Can be a string or an associative array of localized strings. Required parameter. |
USE_SUBSCRIPTION | Use of subscription. Available values - Y or N. Can contain instruction for automation rule to wait for app response. When parameter is empty or not specified - user can configure this parameter in the workflows designer settings. |
PROPERTIES | Array of automation rule parameters. List of values is similar to parameters of RETURN_PROPERTIES. |
USE_PLACEMENT | Enables option to open additional settings for automation rules in the app slider. Can have Y/N values. Optional parameter. |
RETURN_PROPERTIES | Array of returned automation rule values. The parameter manages an automation rule standby time for an app response and can handle the returned data. Attention! System name for the parameter must start with a letter and can contain only the following symbols a-z, A-Z, 0-9 and an underscore.
Each parameter must contain:
[ 'value1' => 'title1', 'value2' => 'title2', 'value3' => 'title3', 'value4' => 'title4', ] |
Example
var params = { 'CODE': 'robot', 'HANDLER': 'http://=$_SERVER['HTTP_HOST']?>/robot.php', 'AUTH_USER_ID': 1, 'NAME': 'Example of automation rule', 'PROPERTIES': { 'bool': { 'Name': 'Yes/No', 'Type': 'bool', 'Required': 'Y', 'Multiple': 'N' }, 'date': { 'Name': 'Date', 'Type': 'date' }, 'datetime': { 'Name': 'Date/Time', 'Type': 'datetime' }, 'double': { 'Name': 'Number', 'Type': 'double', 'Required': 'Y' }, 'int': { 'Name': 'Integer number', 'Type': 'int' }, 'select': { 'Name': 'List', 'Type': 'select', 'Options': { 'one': 'one', 'two': 'two' } }, 'string': { 'Name': 'String', 'Type': 'string', 'Default': 'default string value' }, 'text': { 'Name': 'Text', 'Type': 'text' }, 'user': { 'Name': 'User', 'Type': 'user' } } }; BX24.callMethod( 'bizproc.robot.add', params, function(result) { if(result.error()) alert("Error: " + result.error()); else alert("Success: " + result.data()); } );
© «Bitrix24», 2001-2024