Skip to content
Snippets Groups Projects
Commit ec89f041 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Merge branch '1041942_ImporterDocumentation' into '2020.0'

New documentation for Importer_lib, ImporterMappingFunctions_lib and...

See merge request xrm/basic!148

(cherry picked from commit 4ce3093d)

83fdea1d New documentation for Importer_lib, ImporterMappingFunctions_lib and...
7de10ffc change .build() to newer version in documentation -> toString()
parent 40ea3549
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1">
<name>ImporterCustomMappingFunctions_lib</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/ImporterCustomMappingFunctions_lib/documentation.adoc</documentation>
<process>%aditoprj%/process/ImporterCustomMappingFunctions_lib/process.js</process>
<variants>
<element>LIBRARY</element>
......
:toc2: left
:numbered:
:hardbreaks:
= ImporterCustomMappingFunctions_lib
ADITO Akademie
Version 1.0 | 21.02.2020
<<<
This document is subject to copyright protection. Therefore all contents may only be used, saved or duplicated for designated purposes such as for ADITO workshops or ADITO projects. It is mandatory to consult ADITO first before changing, publishing or passing on contents to a third party, as well as any other possible purposes.
[cols="1,6"]
|====================
| Version | Changes
| 1.0 | Document added
|====================
<<<
== How to build your own ImporterCustomMappingFunctions
First you need to start with the function itself. It normally starts with:
// it's like the heart of your data transport, the functions which will let you choose where it should go
[source,javascript]
--
function iYourFunction(pObject)
{
//your code
}
--
Your name should include a lowercase "i" in the beginning and then camelcase the rest.
*pObject* is your Object which includes all the properties which you define and can use.
In particular the properties can look like this:
[source,javascript]
--
function iYourNewFunction(pObject)
{
var firstName = this.InputRecord[pObject.nameString]
if(firstName == undefined)
this.resolveSymbol(pObject, pObject.nameString);
var sum = this.InputRecord[pObject.sumValue];
.
. //do something with the values
.
}
--
*this.InputRecord* gives you an one dimensional array with your values from the defined configuration. *pObject.YourParameterName* is your value.
*this.resolveSymbol* is a function that resolves the input. It may contain literals string and numbers in curly brackets ({1}) and variables ({tbl.col}).
[WARNING]
The property (for example sumValue) has to have the same name here as well as in the serverprocess!
[source,javascript]
--
//this is in your serverprocess inside your 'Mapping' map
[iYourNewFunction,
{
nameString: "'{0}' + ' ' + '{1}'",
sumValue: 2,
}
]
--
For this example we needed to update user if they are in a different status.
It is always helpful, if you comment your function with the required fields you have to fill.
[source,javascript]
--
//this is in your ImporterCustomerMappingFunctions_lib!
.
.
.
/*
* Values of the mapping line:
* contactID --
*
* @name iUpdateContact
* @param {Object} pObject the mapping line
* @return {Boolean} true
* */
function iUpdateContact(pObject)
{
try
{
var alias = this.Config.AliasTo; //this gets the selected alias
var columns = ["STATUS"];
var types = db.getColumnTypes("CONTACT", columns, alias);
var values = ["CONTACTSTATREVIEW "];
var condition = "CONTACTID = '" + pObject.contactID + "'";
this.updateData("CONTACT", columns, types, values, condition, alias);
}
catch(ex) //If it fails it will not update but continue the rest
{
logging.log(ex); //the error will be logged
return false; //and it will return false.
}
return true;
}
.
.
.
--
\ No newline at end of file
......@@ -3,6 +3,7 @@
<name>ImporterMappingFunctions_lib</name>
<comment></comment>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/ImporterMappingFunctions_lib/documentation.adoc</documentation>
<process>%aditoprj%/process/ImporterMappingFunctions_lib/process.js</process>
<variants>
<element>LIBRARY</element>
......
:toc2: left
:numbered:
:hardbreaks:
= ImporterMappingFunctions_lib
ADITO Akademie
Version 1.0 | 21.02.2020
<<<
This document is subject to copyright protection. Therefore all contents may only be used, saved or duplicated for designated purposes such as for ADITO workshops or ADITO projects. It is mandatory to consult ADITO first before changing, publishing or passing on contents to a third party, as well as any other possible purposes.
[cols="1,6"]
|====================
| Version | Changes
| 1.0 | Document added
|====================
<<<
== Introduction
The ImporterMappingFunctions_lib is the library for all the standard functions that you can use in your importer.
//way more examples and a better introduction
It's important to know, that every data source gives you a two dimensional array and the index within the second dimension of the array are the sources is the source of your properties. In the process the array will be split into each row. The index of the field in the array will be your number which you fill your properties with.
For Example if you have a "DataQuery" datasource your select could look like this:
[source, javascript]
--
newSelect("ID, FIELD1, FIELD2, FIELD3")
.from("TABLE1")
.toString();
--
Therefore the field "ID" would have the place 0 and "FIELD1" would have 1 and so on.
<<<
== Mapping functions
In this library exist different function, which should *never* be edited. If you want to add or change something please create a new function in the ImporterCustomMappingFunctions_lib. There is a documentation on how to create your own functions.
You always have to declare a parameter with certain properties. These properties can have different values and types.
[WARNING]
The numbers for all examples are random selected. You have to configure your sources, values and mappings to your needs!
An example on how to use it could be:
[source, javascript]
--
var yourConfig = {
.
. //these parameters are explained in the importer_lib documentation
.
Mapping: [
[iMappingFunction, //function starts
{ //parameter starts
Property1: 0,
Property2: 2 //a single property
...
} //parameter ends
], //function ends
[iMappingFunction2,
{
Property3: 1,
Property4: 15
}
],
//and so on
]
}
--
More examples are available in the *_test_import* process
<<<
WARNING: If 'Eval' is set to true, the content of the property 'Value' will be converted in Javascript code.
=== iKeyword
iKeyword creates a new keyword in the described container. If the container doesn't exists as well, then it will be created too.
Properties for iKeyword
[cols="1,6"]
|======
|Property | Information
|Keyword | The column index with the new keyword value.
|Container | The keyword container for the keyword lookup.
|======
[source,javascript]
--
Mapping: [
...
[iKeyword,
{
Container: 0,
Keyword: 1
}
],
...
]
--
=== iAttribute
iAttribute creates or updates an attribute
Properties for iAttribute
[cols="1,6"]
|======
|Property | Information
|Attribute | The new/available attribute name.
|AType | The type of the attribute.
|OType (opt.)| The type of the object (AB_ATTRIBUTEUSAGE).
|OID (opt.)| The row ID for the object instance (AB_ATTRIBUTERELATION).
|Value (opt.) | The value for the object instance (AB_ATTRIBUTERELATION).
|======
[source,javascript]
--
Mapping: [
...
[iAttribute,
{
Attribute: 0,
AType: 1
}
],
...
]
--
=== iKeywordAttribute
Creates a new keyword attribute.
Properties for iKeywordAttribute
[cols="1,6"]
|======
|Property | Information
|Attribute | The column index with the new attribute value.
|AType | The type of the attribute.
|Container | The container name of the keyword.
|Keyword (opt.)| A new keyword name or an existing KeyID (AB_KEYWORD_ATTRIBUTERELATION).
|Value (opt.) | The value of the relation (AB_KEYWORD_ATTRIBUTERELATION).
|======
[source,javascript]
--
Mapping: [
...
[iKeywordAttribute,
{
Attribute: 0,
AType: 1,
Container: 2
}
],
...
]
--
=== iComm
Creates a new communication for a contact.
Properties for iComm
[cols="1,6"]
|======
|Property | Information
|Address | The address for the communication entry.
|Medium | The medium ID. (It can also be a flexible value like "{2}" or "{TEMP.MED}").
|ContactID | The ID of the entry in the contact table.
|Standard (opt.)| If this address should be set to standard (boolean).
|======
[source,javascript]
--
Mapping: [
...
[iComm,
{
Address: 3,
Medium: 2,
ContactID: 1,
Standard: 4
}
],
...
]
--
=== iCommRestriction
Creates a communication restriction for a contact/person/organisation.
Properties for iCommRestriction
[cols="1,6"]
|======
|Property | Information
|Medium | The medium which should be restricted.
|ContactID | The ID of the entry in the contact table.
|Reason (opt.)| The string for the reason.
|======
[source,javascript]
--
Mapping: [
...
[iCommRestriction,
{
Reason: 2,
Medium: 1,
ContactID: 0
}
],
...
]
--
=== iActivityLink
Creates a new link between a contact and the activity. It does not update only inserts.
Properties for iActivityLink
[cols="1,6"]
|======
|Property | Information
|ActivityID | The column specifier for the activity table.
|OID | The ID for a default object for object_rowID.
|OType | The context name. (e. g. "Person").
|======
[source,javascript]
--
Mapping: [
...
[iActivityLink,
{
ActivityID: 2,
OID: 1,
OType: 0
}
],
...
]
--
=== iDocumentByPath
Imports an document from a given path into asys_binaries.
Properties for iDocumentByPath
[cols="1,6"]
|======
|Properties | Information
|Rowid | The ID for the relation.
|Filename | The name of the file.
|Value | The path of the file.
|DateNew | Current date for the insert.
|======
[source,javascript]
--
Mapping: [
...
[iDocumentByPath,
{
Rowid: 0,
Filename: 2,
Value: "{4}",
DateNew: 2
}
],
...
]
--
=== iDocument
Imports an document. Only inserts.
Properties for iDocument
[cols="1,6"]
|======
|Property | Information
|Source | The input data of the document e. g. base64 string.
|Action (opt.) | Only inserts.
|Description | The description of the file.
|Tablename | The table the document should be inserted into.
|Filename | The name of the file.
|Rowid | The ID for the relation.
|Keywords | The keywords for the document.
|======
//[source,javascript]
//hier ist kein sinnvolles beipsiel vorhanden, da die dokus in asys_binaries gespeichert werden sollen.
INFORMATION: Here is no example because all documents should be saved in asys_binaries.
=== iMove
Move import data to target.
Properties for iMove
[cols="1,6"]
|======
|Property | Information
|Source | The input data.
|Value | Alternative to 'Source'. 'Eval' can be used.
|Target | The column the input should be saved in.
|Map (opt.)| Selects a Map with an Index.
|Index (opt.)| If you use a Map then.
|Eval (opt.)| Values can be true/false. Pick true if you want to use functions in your value or map expression.
|Blobfile (opt.)| The blobfile.
|Trim (opt.)| In which direction it should be trimmed to. Values could be "left", "right" or "both".
|Replace (opt.)| The value that should be replaced.
|ReplaceTo (opt.)| The value it should replace.
|HTML2Text (opt.)| If it is set it will convert HTML-text to a normal string.
|RTF2Text (opt.)| The data for the document.
|======
[source,javascript]
--
Mapping: [
...
[iMove,
{
Value: "'{1}' == 'aktiv' ? $KeywordRegistry.contactStatus$active : $KeywordRegistry.contactStatus$inActive ",
Target: "PERSON.STATUS",
Eval: true
}
],
...
]
--
=== iWord
Return word number "Index" from source column.
Properties for iWord
[cols="1,6"]
|======
|Property | Information
|Source | The input data.
|Value | Alternative to 'Source'. 'Eval' can be used.
|Target | The column the input should be saved in.
|Regex (opt.)| The regular expression for the split.
|Index (opt.)| The word number starting with 0.
|Substring (opt.)| Values "right" or "left".
|Separator (opt.)| Concatenation string, default is blank.
|======
[source,javascript]
--
Mapping: [
...
[iWord,
{
Value: "'{1}'.trim()",
Target: "PERSON.SALUTATION",
Eval: true
}
],
...
]
--
=== iNewID
Returns a new ID for a key field.
Properties for iNewID
[cols="1,6"]
|======
|Property | Information
|Action | Default is insert "I". The action it should execute.
|Target | The column the input should be saved in.
|======
[source,javascript]
--
Mapping: [
...
[iNewID,
{
Target: "PERSON.PERSONID"
}
],
...
]
--
=== iJoin
Returns a joined list of columns into the specified target column.
Properties for iJoin
[cols="1,6"]
|======
|Property | Information
|Source | The input data in an array.
|Value | Alternative to 'Source'. 'Eval' can be used.
|Delimiter | The delimiter string.
|Target | The column the input should be saved in.
|======
[source,javascript]
--
Mapping: [
...
[iJoin,
{
Source: [3, 5],
Delimiter: "\n",
Target: "ORGANISATION.NAME"
}
],
...
]
--
=== iSql
Executes an SQL statement with the data from the input. Returns the value to the target column.
Properties for iSql
[cols="1,6"]
|======
|Property | Information
|Command | The sql command (use {0}..{n} to specify source indexes).
|Alias | The alias that should be used for this query.
|Target | The column the input should be saved in.
|======
[source,javascript]
--
Mapping: [
...
[iSql,
{
Command: newSelect("SALUTATION")
.from("PERSON")
.where("PERSONID = '{0}' and LETTERSALUTATION IS NULL")
.build(),
Alias: "Data_alias",
Target: "PERSON.LETTERSALUTATION"
}
],
...
]
--
=== iInsertUpdate
Inserts or updates a table. Here you can insert/update more columns at once.
Properties for iInsertUpdate
[cols="1,6"]
|======
|Properties | Information
|Table | The table that the dataset should be inserted/updated to.
|Alias | The alias for the table.
|Columns | All the data you need. Columns is an object. (see next table for the properties of this object).
|Condition | An extra condition.
|Action | The action it should be executed. Values: "I" / "U" / "I+U".
|======
Properties for "Columns".
[cols="1,6"]
|======
|Properties | Information
|Name | The column of the table.
|Souce | The input data.
|Value | Alternative to 'Source'. 'Eval' can be used.
|Key | The primary key of the table. It compares if this ID already exists and if it does it will be updated.
|======
For example:
[source,javascript]
--
Mapping: [
...
[iInsertUpdate, {
Table: "AB_ATTRIBUTERELATION",
Condition: "OBJECT_TYPE = 'Person' and OBJECT_ROWID = '{0}' and AB_ATTRIBUTE_ID = 'd9a29c9f-d32a-49bb-a02a-43b577c74a2e'",
Alias: "Data_alias_NoAudit",
Columns: [
{
Name: "AB_ATTRIBUTERELATIONID",
Key: true
},
{
Value: "d9a29c9f-d32a-49bb-a02a-43b577c74a2e",
Name: "AB_ATTRIBUTE_ID"
},
{
Value: "{0}",
Name: "OBJECT_ROWID"
},
{
Value: "Person",
Name: "OBJECT_TYPE"
},
{
Source: 3,
Name: "USER_NEW"
},
{
Source: 4,
Name: "DATE_NEW"
},
{
Source: 25,
Name: "CHAR_VALUE"
}
]
}],
...
]
--
=== iTimestamp
Import a timestamp string in a specified format into a date field.
Properties for iTimestamp
[cols="1,6"]
|======
|Property | Information
|Source | The input data. (As normal value like "12.12.2019").
|Value | Alternative to 'Source'. 'Eval' can be used.
|Target | The column the input should be saved in. (As long)
|Format | The timestamp format, default is yyyy-MM-dd HH:mm:SS.
|Timezone | The timezone string, default is UTC.
|======
[source,javascript]
--
Mapping: [
...
[iTimestamp,
{
Source: 3, //for example: 12.12.2019 13:00:00
Target: "PERSON.DATE_EDIT",
Format: "dd.MM.yyyy HH:mm:SS"
}
],
...
]
--
=== iDecode
Decode an input entry by searching through a translation list.
Properties for iDecode
[cols="1,6"]
|======
|Property | Information
|Source | The input data.
|Value | Alternative to 'Source'. 'Eval' can be used.
|Target | The column the input should be saved in.
|List | The decode list. Format is: data;replacement;data;replacement... .
|======
[source,javascript]
--
Mapping: [
...
[iDecode,
{
Source: 3,
Target: "PERSON.TITLE",
List: 5
}
],
...
]
--
=== iGlobalVar
Save an input in a global variable.
Properties for iGlobalVar
[cols="1,6"]
|======
|Property | Information
|Source | The input data.
|Value | Alternative to 'Source'. 'Eval' can be used.
|Name | The name for the global variable.
|======
[source,javascript]
--
Mapping : [
...
[iGlobalVar
{
Value: "{3}",
Name: "importLogin" //--> $global.importLogin
}
],
...
]
--
=== iCharMap
Do character set translation. basically works like iMove, but allows to specify a conversion map that will be used to process the input data.
Properties for iCharMap
[cols="1,6"]
|======
|Property | Information
|Source | The input data.
|Value | Alternative to 'Source'. 'Eval' can be used.
|Target | The column the input should be saved in.
|Map | The decode map.
|Method | The method it should use. Values: "js" (default) or "replaceall".
|======
[source,javascript]
--
Mapping : [
...
[iCharMap
{
Value: "{3}",
Target: "PERSON.GENDER",
Map: 4
}
],
...
]
--
<<<
\ No newline at end of file
......@@ -2,6 +2,7 @@
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1">
<name>Importer_lib</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/Importer_lib/documentation.adoc</documentation>
<process>%aditoprj%/process/Importer_lib/process.js</process>
<variants>
<element>LIBRARY</element>
......
:toc2: left
:numbered:
:hardbreaks:
= Importer_lib
ADITO Akademie
Version 1.0 | 21.02.2020
<<<
This document is subject to copyright protection. Therefore all contents may only be used, saved or duplicated for designated purposes such as for ADITO workshops or ADITO projects. It is mandatory to consult ADITO first before changing, publishing or passing on contents to a third party, as well as any other possible purposes.
[cols="1,6"]
|====================
| Version | Changes
| 1.0 | Document added
|====================
<<<
toc::[]
<<<
== Introduction
In order to understand the importer, the logical order is to start with the importer_lib, followed by the importerMappingFunctions_lib and importerCustomMappingFunctions_lib.
TIP: You have to import these libraries with the import("") JDito command. Mapping functions won't show up with code completion!
<<<
=== The Importer_lib
This library is used to initialize the importer and its functions. If you want to create an instance of this object you need a process which includes:
[source,javascript]
--
var imp = new Importer(yourConfig);
--
*yourConfig* includes your configuration. For example into which alias you insert your data into.
Your configuration could look like this:
[source,javascript]
--
var yourConfig = {
AliasTo: "AO_DATEN",
DataFile: "C:/CurrentProject/Import/Customer.csv", //Example for a CSV-Import
HeaderLines: 1,
RowSeparator: "\n",
ColumnSeparator: ";",
StringDelimiter: "",
ImportCommand: "insert",
Mapping: [] //See ImporterMappingFunctions_lib documentation
--
If you want to add your functions and parameters you can do that after you initialised your importer. You add them like so (variablename.parameterName):
[source,javascript]
--
imp.Log = "CONSOLE";
imp.ImportUser = "IMPORT"; //the standard USER_NEW
imp.Preview = false;
imp.Debug = true;
imp.ProgressCallback = writeResults;
imp.skipEmptyValue = false;
imp.BatchSize = 100000; //declares how many batches will be done in the importer.
imp.process(); //this function starts the importer and should be the last one.
--
Configure your importer to your needs. These are the parameters/properties/functions you can use to edit your importer. Every description is available with the code completion (ctrl + spacebar).
<<<
== Datasource
An importer can use different data sources. For every datasource there are unique properties you need to fulfill. The datasource types are "xml", "array", "table" and "file"
Their properties are shown below.
[cols="1,6"]
|===================
|Type | Property
|XML | XMLObject or DataFile
|Array | DataFunction
|File | DataFile
|Table | DataQuery
|===================
//If you want to use an array you have to write a function for the 'DataFunction'.
//If you want to use a SQL-statement you have to use 'DataQuery' with the SQL-string.
[WARNING]
The 'Mapping' property will be empty in these examples. The full description for that is available in the ImportMappingFunctions_lib documentation.
The following examples will show you how you can implement the different datasources and what parameters you can use.
Data source type -> Property
=== Array -> DataFunction:
[source,javascript]
--
var yourConfig = {
DataFunction: function (pBatchNum, pBatchSize)
{
pBatchNum = pBatchNum - 1;
if(array.length < 0)
{
return null;
}
var end = (pBatchNum + 1) * pBatchSize;
return array.slice(pBatchNum * pBatchSize, end);
},
ImportCommand: "insert+update",
AliasTo: "Data_alias_NoAudit",
AliasFrom: "Data_alias",
Mapping: []
}
--
[cols="1,6"]
|====
|Parameter | Description
|DataFunction | Function that returns a two-dimensional array.
|ImportCommand| What action you want you. Insert/Update/Insert+Update
|AliasTo | The Alias you want to insert your data into.
|AliasFrom | The Alias you read your data from.
|====
//------------------------------------
=== Table -> DataQuery:
[source,javascript]
--
var yourConfig = {
DataQuery: newSelect("PERSONID, FIRSTNAME, LASTNAME, DOB")
.from("PERSON")
.toString(),
ImportCommand: "insert",
AliasTo: "Data_alias_NoAudit",
AliasFrom: "Data_alias",
Mapping: []
}
--
[cols="1,6"]
|====
|Parameter | Description
|DataQuery | SQL-String you want your data from.
|ImportCommand| What action you want you. Insert/Update/Insert+Update
|AliasTo | The Alias you want to insert your data into.
|AliasFrom | The Alias you read your data from.
|====
//------------------------------------
=== File -> DataFile:
[source,javascript]
--
var yourConfig = {
DataFile: "C:/aditos/Imports/Postliste.csv",
HeaderLines: 1,
RowSeparator: "\r\n",
ColumnSeparator: ";",
StringDelimiter: '"',
ImportCommand: "insert",
AliasTo: "Data_alias_NoAudit",
Mapping: []
}
--
[cols="1,6"]
|====
|Parameter | Description
|DataFile | The file-path of the data you want to read.
|HeaderLines | How many lines get ignored for the import. Counted from the top down.
|RowSeparator | The RegEx or string you want to separate each row.
|ColumnSeparator | The RegEx or string you want to separate each column.
|StringDelimiter | The string you want delimit your data.
|AliasTo | The Alias you want to insert your data into.
|====
NOTE: If your CSV import is not working correctly, it could be that the charset is not right!
//------------------------------------
=== XML -> XMLObject:
The XML-string has to look like this. 'CDATA' is necessary otherwise you can run into errors.
[source,xml]
--
<data>
<row>
<column><![CDATA[ADITO Software GmbH]]></column>
<column><![CDATA[Konrad Zuse Str. 4]]></column>
<column><![CDATA[84144]]></column>
<column><![CDATA[Geisenhausen]]></column>
</row>
</data>
--
[source,javascript]
--
var yourConfig = {
AliasTo: "AO_DATEN",
XMLObject: xmlString,
Mapping: []
}
--
[cols="1,6"]
|====
|Parameter | Description
|AliasTo | The Alias you want to insert your data into.
|XMLObject | The XML-object
|====
//------------------------------------
=== XML -> DataFile:
[source,javascript]
--
var yourConfig = {
AliasTo: "AO_DATEN",
DataFile: "C:/aditos/Imports/Structure.xml", //if the file extension ends with XML it will be interpreted as a XML
Mapping: []
}
--
[cols="1,6"]
|====
|Parameter | Description
|AliasTo | The Alias you want to insert your data into.
|DataFile | The file path of the data you want to read.
|====
//------------------------------------
== Conclusion
If you set all necessary properties and settings you are good to go. Your overall result could look like this:
[source,javascript]
--
var yourConfig = {
DataFile: "C:/aditos/Imports/Person.csv",
HeaderLines: 1,
RowSeparator: "\r\n",
ColumnSeparator: ";",
StringDelimiter: '"',
ImportCommand: "insert",
AliasTo: "Data_alias_NoAudit",
Mapping: [
[iNewID,
{
Target: "PERSON.PERSONID"
}
],
[iMove,
{
Source: 1,
Target: "PERSON.FIRSTNAME"
}
],
[iMove,
{
Source: 2,
Target: "PERSON.LASTNAME"
}
],
[iMove,
{
Source: 3,
Target: "PERSON.DOB"
}
]
]
};
var imp = new Importer(yourConfig);
imp.Log = "CONSOLE";
imp.ImportUser = "IMPORT";
imp.Preview = false;
imp.Debug = true;
imp.skipEmptyValue = false;
imp.BatchSize = 100;
imp.process();
--
<<<
== FAQ
- Q: How can set my own timeout?
A: Use setTimeout in your configuration (E.g., imp.setTimeout(123))
[source,javascript]
--
var imp = new Importer(yourConfig);
.
.
.
imp.setTimeout(123);
imp.process();
--
- Q: How can I log my defined variables in the mapping functions?
A: You can add a function to your mapping functions like:
[source,javascript]
--
[function(){
var expr = [];
expr.push(this.resolveSymbol({}, "{var.configID}", false));
logging.log(expr);
}, {}]
--
WARNING: This is only for debugging usage. This should never be tested in your live system!
- Q: How do I use the LogCallback function?
A: Here is an example:
[source,javascript]
--
var imp = new Importer(yourConfig);
.
.
.
imp.LogCallback = function(plogLevel,pMessage)
{
if(plogLevel==0||plogLevel==1)
{
FileIO.storeData(logFile, "plogLevel: "+plogLevel+". Importer importTitelFreistellung Log: "+pMessage +"\n", util.DATA_TEXT, true);
}
};
imp.process();
--
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment