bizproc.activity.add
Scope: catalog Permissions to execute: for all
Description
bizproc.activity.add adds new activity to a workflow.
Each document generates a fields set to be handled. For example, CRM has the Address field, it is designated as UF:address
. To use this type of field in your activities, specify a CRM document to be handled (DOCUMENT_TYPE key)
and then this type of activities can be described (PROPERTIES key).
Parameters
Parameter | Description |
---|---|
CODE* | Internal activity ID, unique within the application framework. Permissible symbols are a-z, A-Z, 0-9, period, hyphen and underscore. |
HANDLER* | URL, to which the activity will send data (via bitrix24 queue server), when workflow has reached its completion. Shall reference to the same domain, where the app is installed. |
AUTH_USER_ID | ID of the user, whose token will be passed to the application. |
USE_SUBSCRIPTION | Use of subscription. Permissible values - Y or N. It is possible to specify, whether the activity should or should not await for a response from the application. If the parameter is empty or not specified - user himself/herself can configure this parameter in settings of the activity in the workflows designer. |
NAME* | Name of activity. It can be a string or an associative array of localized strings. |
DESCRIPTION | Description of activity. Can be a string or an associative array of localized strings. |
PROPERTIES | Array of activity parameters. |
RETURN_PROPERTIES | Array of returned activity values. Attention! System name of parameter shall start with a letter and can contain only the following symbols: a-z, A-Z, 0-9 and an underscore.
Each parameter is required to have the following:
|
DOCUMENT_TYPE | Tip of document, which will determine type of data for parameters. |
FILTER | Activity limitation rules by document type and revision. |
USE_PLACEMENT | Enables option to open additional settings for activity in the app slider. Can have Y/N value. |
* - required parameters
Example
var params = { 'CODE': 'md5', 'HANDLER': 'http://yanzh.net16.net/ping.php', 'AUTH_USER_ID': 1, 'USE_SUBSCRIPTION': 'Y', 'NAME': { 'en': 'MD5 generator' }, 'DESCRIPTION': { 'en': 'Activity returns MD5 hash of input parameter' }, 'PROPERTIES': { 'inputString': { 'Name': { 'en': 'Input string' }, 'Description': { 'en': 'Input string for hashing' }, 'Type': 'string', 'Required': 'Y', 'Multiple': 'N', 'Default': '{=Document:NAME}' } }, 'RETURN_PROPERTIES': { 'outputString': { 'Name': { 'en': 'MD5' }, 'Type': 'string', 'Multiple': 'N', 'Default': null } }, 'DOCUMENT_TYPE': ['lists', 'BizprocDocument', 'iblock_1'], 'FILTER': { INCLUDE: [ ['lists'] ] } }; BX24.callMethod( 'bizproc.activity.add', params, function(result) { if(result.error()) alert("Error: " + result.error()); else alert("Success: " + result.data()); } );
Example of workflow parameters
select 'docType': { 'Name': { 'en': 'Document type' }, 'Required': 'Y', 'Multiple': 'N', 'Default': 'PDF', 'Type': 'select', 'Options': { 'pdf': 'PDF', 'docx': 'DOCX' } } bool 'saveDoc': { 'Name': { 'en': 'Save document' }, 'Description': { 'en': 'Assign a sequential number' }, 'Type': 'bool', 'Required': 'Y', 'Multiple': 'N', 'Default': 'Y' } string 'Parameters': { 'Name': { 'en': 'Templates parameters' }, 'Description': { 'ru': 'ParamID={=ParamValue}', 'en': 'ParamID={=ParamValue}' }, 'Type': 'string', 'Required': 'N', 'Multiple': 'Y' }
© «Bitrix24», 2001-2024