Execute Task

Prev Next

Create/Update Item in Another Module


This action task is used to update and create entries in other modules according to configured field mapping.

While configuring mapping put field definition IDs of the Source module from the left and Target module from the right side of equality clause as in the example below.

targetModule=31

updateOnly=true

ignoreValidation=true

runActionsInTargetModule=true

# Field mapping section

map.fd103=fd104,key

map.fd375=fd376

map.fd105=fd107,ident334

map.fd106=fd108,key,ident334

In order to map Ref# field as a key use Field Definition with ID=0. e.g.:

map.fd389=fd0,key

To map one field definition on multiple fields in the target module insert any additional letters after the keyword map. and before fd[ID]. For example:

map.fd112=fd35,key

map.toProductTextfd112=fd81runActionsInTargetModule=true

map.toDescriptionfd112=fd321

Create/Update item in another module has next properties:

Property

Value

Description

targetModule

integer

ID of the module where items will be updated

updateOnly

true/false

Property defines whether new item will be created in case none of existing items match key field

ignoreValidation

true/false

Property defines whether validation will be applied in target module on new item creation. For example, if required field is present in the target module, it will be validated and the item will not be created with empty field. Setting ignoreValidation=true omits all validations, so the item will be created even if required field is empty.

runActionsInTargetModule

true/false

Property specifies whether actions that are configured in the target module will be run.

This property is also applicable to execution of Rules.

skipUnChanged

true/false

If this property is enabled, items without changes will not be processed. this helps to decrease the system load on massive operations with many items

,key

-

Attribute defines key mapping. Values of these fields will be compared during Create/Update item in another module Action_._ In case no item matched — new one will be created if updateOnly property allows to.

,ident[ID]

-

Attribute defines mapping on module link field. After ident attribute id of the field that module link refers to must be specified.

,allCombinations

-

Attribute defines the creation of combinations in the target module and will be automatically used as a key

Field Combinator 

Create/Update item in another module task can be used for generating a set of items based on the combination of some predefined values that are stored in the master item.

This allows to quickly generate various items with specific values and these items will not be copies of each other.

To make this work you need:

  • The multiselect fields in the source module which will be used as a source of values to generate target items;

  • The corresponding single select field in the target module;

  • Configured Create/Update item in another module execute task action with mapped module link fields mentioned above. The attribute ,allcombination must be used for each mapping.

Now when creating the master item and specifying the values in the mapped fields, the action will create items in the target module based on combinations of these values in the master item.

Example

Having the Source module "P-Generator" (1) with multiselect fields the Target module "Primitives" (2) with the corresponding single select fields:

Field Name

Options

Color

Red, Green, Blue

Form

Square, Circle, Rectangle

Having the action Create/Update item in another module configured in the module "P-Generator" with such parameters:

# ID of the target module 
targetModule=2

# Specify field, that will be used for creation of combinations in target module
map.fd10=fd12,allCombinations
map.fd11=fd13,allCombinations

Create the master item in the module "P-Generator" with such values in mapped fields:

  • Color: Red, Green, Blue

  • Form: Square, Circle

As a result, the action will generate 6 items based on combinations in the module "Primitives":

Item

Color

Form

Item 1

Red

Square

Item 2

Red

Circle

Item 2

Green

Square

Item 4

Green

Circle

Item 5

Blue

Square

Item 6

Blue

Circle

In the target module "Primitives" you may want to have a Send Email action triggered on "Batch Combinations" event where you can fetch the summarized data about created items. See the Send Email on Batch Operations Actions article for more details.

Link Changed Item


Action performs the linking updated/created items with another module in the same way as it is done in Image Linking Job.

To make ImageLinkingJob start on item create or update event, perform the following:

  1. Create an action to be triggered on “create” or “update” event.

  2. Select Action of the type “Execute task”.

  3. Enter Image Linking Job parameters and save the action. 

Property

Description

ModuleLinker

ID of the ting module (e.g. Images) with a link to the linked module (e.g. Products)

FieldModuleLink

ID of a Module Link field belonging to module mapped in ModuleLinker (for direct linking) or ModuleLinked (for reverse linking)

FieldProductText

ID of the field holding linking values, which belongs to module mapped in ModuleLinker

ModuleLinked

ID of the existing module (e.g. Products), to which linker module is referencing (e.g. Images)

FieldProductID

ID of a field belonging to module mapped in ModuleLinked

Delimiters

Delimiters for values. E.g. Comma, semi-colon, forward slash, space etc.

Pattern

Valid Regular Expression for finding link items. Ex:.

(\\d+) — value contain one or more digits

(pic-\\d+) — value starts with prefix ‘pic-’ with the following one or more digits

Pay attention:

  • regular expression must be enclosed in parentheses

  • metacharacters must be preceded by double backslash instead of single one. E.g., use \\d instead of \d to match the digit

createNew

Enable/Disable creation of new items in the Linked module

ignoreValidation

Enable/Disable validation for Link changed item task. If enabled, action cannot be saved with wrong values in parameters

In order to keep track on changes in “linker” and “linked” modules at the same time, actions should be set up in both modules correspondingly.

Assign User Group


This task performs assigning the required multiple user groups to item automatically on Create/Update item according to the group names values stored in item’s fields.

The following configuration options are present when configuring Assign User Group action:

  • sourceFields - this parameter assigns user groups ignoring group hierarchy and accepts a comma-separated list of field IDs.

  • level1 (level2... levelN) - does user group assignment and creation respecting user group hierarchy.

  • assignGroupsToItem - should be set to true when assignment of user groups to item on action event is needed.

  • assignGroupsToUser - parameter to be used solely in actions of the User Management module. Will assign mapped fields values representing user groups to a user.  Precondition for using this should be: "Assigned by action" set as User group selection mode in Site Configuration > User settings > User Groups. Note, that assignGroupsToItem parameter should be set to false, if assignGroupsToUser is set to true.

  • createGroups - when set to true, will create user group corresponding to the mapped field's value in case group has not been created previously.  This parameter can be used both for assignment of the groups to users and to items. Note, that new user groups will not be created in case sourceFields parameter is used as user groups source.

Please note the following action setup differences in versions prior to 9.97 and after

  • The 2 configuration options listed above are available starting from version 9.97. For earlier versions, only sourceFields parameter can be used.

  • Prior to version 9.97 it was possible to specify group id or group name in field mapped in user group assignment. Starting from version 9.97 only name is accepted.

  • resetExisting task parameter is removed in 9.97 - previously assigned groups are always overwritten.

  • Assignemt of user groups by actions will only be done in case groups restriction type of the module is set to "Assigned by action"

Please, note the following know behavior and limitations  related to the Create/Assign User groups functionality

  • Assignment of group restriction by the configured actions in regular modules works only when group restriction type in module Settings is set to "Assigned by action". Please note that assignment of user groups to users by actions, are not controlled by group restriction type of the user management module, only by the “Group Selection Mode” setting in User group - Settings.

  • It is important to make sure that actions assigning user groups to users have assignGroupsToItem set to “false”

  • "Overwrite existing" action setting has been removed and is now always true

  • Assignment of user groups will now be done only by group name, assignment by group ID is no longer supported

  • Previously existing "Assign user group actions" are converted to a new type of action "Assign/Create User Groups" that supports group hierarchy. Configurations existing prior to version 9.97 will not be changed. 

  • User group hierarchy cannot have missing parent values. In such cases assign group action will fail.

  • Assignment of user groups will also fail in case duplicate value (already existing group) is present. (e.g. Same subgroup under different parent)

  • Assigning user groups it is important to specify correct level. User group will not be assigned or created if it is present on another level than specified in action settings.

  • Assignment/creation of user groups using group hierarchy is only possible when all the levels starting from root (level 1) are specified. The following configuration will not work and it will not be possible to save the action:

level2=id
level3=id 
  • Modified field values mapped for user groups assigmenmt will not modify previously created user groups. New user group will be created instead

  • To use the automatic group assignment by actions during bulk user import, field values mapped needs to be passed in the request. Also note that user groups should not be present in API request for bulk user creation.

  • Assigning user groups by actions cannot be used together with automatic assignment of user groups by the IDP. It means that, if you have IDP configuration that assigns user groups to a user, action cannot be used.