MtsResourceModule
Note
Python Module Subclasses
PPMSCSVModule
- Can write CSV files which can be read by PPMS 38.
- The format of these CSV files looks as follows:
CODE
@BEGIN GLOBAL SEPARATOR ; ESCAPE @ @END GLOBAL @BEGIN MODULE MODULE @ @END MODULE wert_1;wert_2 wert_1;wert_2
Use | Possible ? |
---|
Source module | No |
Pool module | No |
Target module | Yes |
Parameters | Function |
---|
filepath | Path of the file to be exported. It can either be in relation to the server directory or be an absolute path on the server. |
delimiter | Separator within the CSV file |
escapechar | Character used to escape the delimiter within a value |
encoding | Codec with which the file is encoded |
overwrite | Defines whether an already existing file is to be overwritten during export |
quoting | Defines whether the values are to be written/read in inverted commas. Possible values can be found in the Python Documentation |
MtsModule
Sends and writes data in PLANTA using the Mts layer.
All data that was sent from this module is of the strings type, and as a recipient, the module also expects all values to be strings.
Data fields which occur in the mapping but are not available in the data area are ignored without warning.
Data fields in window 9 are not filled.
The module determines the table to which is imported on the basis of the DDI.
Provides a field length check.
- The field length check is not carried out for date fields.
Use | Possible ? |
---|
Source module | Yes |
Pool module | No |
Target module | Yes |
Parameters | Function |
---|
sorted | Values- 0 = The values are exported in a random order.
- 1 = The data is exported in the order defined in the source module. The data area from which the data is exported must not have a parent data area.
|
da_name | Python ID of the data area to which data is imported or exported. If the MtsModule is set as a target module, the parameter can remain empty. This implies that all data areas in the module are used as import targets. |
Note
- MtsModule interprets the following input as valid values for checkboxes:
- Deactivated: 'N', '@N', '0', '', 'FALSE'
- Activated: 'Y', '@Y', '1', 'J', 'TRUE', 'X'
MtsProjectModul
Sends and writes data in PLANTA using the Mts layer.
All data that was sent from this module is of the strings type, and as a recipient, the module also expects all values to be strings.
Data fields which occur in the mapping but are not available in the data area are ignored without warning.
Data fields in window 9 are not filled.
The module determines the table to which is imported on the basis of the DDI.
Provides a field length check.
- The field length check is not carried out for date fields.
Use | Possible ? |
---|
Source module | Yes |
Pool module | No |
Target module | Yes |
Parameters | Function |
---|
sorted | Values- 0 = The values are exported in a random order.
- 1 = The data is exported in the order defined in the source module. The data area from which the data is exported must not have a parent data area.
|
da_name | Python ID of the data area to which data is imported or exported. If the MtsModule is set as a target module, the parameter can remain empty. This implies that all data areas in the module are used as import targets. |
auto_task_id | The Python ID for automatic creation of a task (e.g. to import costs to it). If the parameter is not filled, no task is created. The parameter is only available if the module is used as a target module in import. |
auto_task_name | Name for the automatically created task. The parameter is only available if the module is used as a target module in import. |
MtsLiabilityModule
Function and use analogously to MtsModule except for the following differences:
- Beim Datenimport werden alle Obligo-Werte geleert, d.h., die folgenden DIs werden global auf 0 gesetzt:
DI060503 Obligo aus DT282 (Obligo-Wert des Projekts im ausgewählten Jahr für die ausgewählte Kostenartengruppe bzw. für alle Kostenartengruppen)
DI060189 Obligo aus DT281 (Obligo-Wert des Projekts für die ausgewählte Kostenartengruppe bzw. für alle Kostenartengruppen ohne Berücksichtigung seiner Teilprojekte)
- Die Schnittstelle kennzeichnet die Pool-Datensätze, die sie importiert, mit einem Obligo-Flag.
- Beim Import werden alle Pool-Datensätze, die als Obligo geflagged sind und noch nicht übertragen wurden, gelöscht. Bereits übertragene Werte werden zur Archivierung im Pool stehen gelassen.
- Wurden alle Jahresscheiben für ein Projekt korrekt importiert, werden die folgenden DIs aus der DT461 gestempelt:
MtsPoolModule
- Works like an MtsModule but stamps Status and Transferred on in DT 567.
- The module only works correctly if the pool table has been customized correctly (see Interface Customizing).
Use | Possible ? |
---|
Source module | No |
Pool module | Yes |
Target module | No |
Parameters | Function |
---|
sending_da | Data area from which the data is loaded in the Pool → Target step Note: - From DB 39.5.8, the
sending_da and receiving_da parameters replace the former da_name parameter. - Data of already existing interface configurations is automatically migrated during an update.
- Individual classes that inherit from
MtsPoolModule are also lifted to the current status.
|
receiving_da | Data area in which the data is stored in the Source → Pool |
l_var | The number to be filled with the current interface configuration in the pool module. Allows you to restrict the pool table to the records of the current transaction. |
Information
- The constellation allows for a more flexible customizing. You can now import to a "technical" data area which contains the raw fields and is then exported from a processed data area which processes data using functions like grouping or summarization.
CSVModule
- Can read and write CSV files
- It can only import files that can be accessed from the application server using the user which runs the PLANTA service.
- Here you can take a plain dummy data area with a field as a data area.
- If the module is used as a source module and the readheader parameter is 1, the source mappings correspond to the column names in the file.
- If the parameter is 0, the position is used for column definition instead.
- If the module is used as a target module and the writeheader parameter is 1, the target mappings correspond to the column names in the file.
- If the parameter is 0, the position is used for column definition instead.
Use | Possible ? |
---|
Source module | Yes |
Pool module | No |
Target module | Yes |
Parameters | Function |
---|
archive_dir | Path to a directory to which the file is to be moved after successful import. It can either be in relation to the server directory or be an absolute path on the server. If the parameter is empty, the server directory is used. If the directory does not exist, it will be created. |
filepath | Path of the file to be imported or exported. It can either be in relation to the server directory or it can be an absolute path on the server. Wildcards like * can be used in the name. If several files are found, an error is displayed. |
delimiter | Separator within the CSV file If you want to use a tab as a separator, you have to enter /t . |
escapechar | Character used to escape the delimiter within a value |
encoding | Codec with which the file is encoded |
writeheader | Defines whether a title line is written during export |
readheader | Defines whether the first line or the source mappings display the column names in the CSV file |
overwrite | Defines whether an already existing file is to be overwritten during export |
quoting | Defines whether the values are to be written/read in inverted commas. Possible values can be found in the Python Documentation. |
Notes
Nachdem eine Datei erfolgreich importiert wurde, wird die UUID der Schnittstellen-Konfiguration in den Dateinamen geschrieben und die Datei in das über
archive_dir
konfigurierte Verzeichnis verschoben.
- If a CSV export is carried out, placeholders can be used in the
filepath
parameter in order to format a time stamp. The possible placeholders can be found in the Python documentation.
The most common encoding values are:
encoding | Used by |
---|
latin-1 | Default Microsoft Excel encoding on German computers |
windows-1252 | Default Microsoft Excel encoding on English computers |
utf-8 | UTF-8 encoded file without BOM |
utf-8-sig | UTF-8 encoded file with BOM |
MultiCSVModule
Information
- This module subclass equates to the CSVModule module subclass.
- It only differs in the
filepath
parameter.- If several files are found, no error is displayed when using MultiCSVModule, but the files are imported/exported one by one in the sequence of their file names.
ClientCSVModule
Information
- This module subclass equates to the CSVModule module subclass.
- In contrast to this module subclass, however, the
filepath
and archive_dir
parameters do not exist here.
- Unlike the CSVModule, ClientCSVModule can import/export files which are accessible for the user that opens the PLANTA Client.
MtsLoadModule
- Imports load records and stamps them in the Imported on (DI063670) and Imported by (DI063672) fields from DT472 Loads.
- Exports load records and stamps them in the SAP status (DI060750), Exported on (DI003399) and Exported by (DI003402) fields from DT472 Loads.
Use | Possible ? |
---|
Source module | Yes |
Pool module | No |
Target module | Yes |
MtsExportPoolLoadModule
- Works like MtsPoolModule but additionally stamps the SAP status (DI060750), Exported on (DI003399) and Exported by (DI003402) fields from DT472 Loads.
- Can only be used for export interfaces.
Use | Possible ? |
---|
Source module | No |
Pool module | Yes |
Target module | No |
MtsResourceModule
- Module subclass for the import of resources and their corresponding data (person, user, role, stakeholder)
- Since currently the creation and update of resource data still make high demands on the module subclass, an import with the standard MtsModule presents some difficulties.
- MtsResourceModule meets these demands and allows, e.g., for the batch-import of resource data.
- If you want to use an individual interface, you have to create a subclass of MtsResourceModule and adjust the PERSON_DA, ROLE_DA, RESOURCE_DA and STAKEHOLDER_DA class attributes to the customizing IDs of the respective data areas.
- The standard MtsResourceModule points to the data areas of the Employee Import standard interface.
- If the ROLE_DA attribute points to a valid role data area, the 01100214 MP user and 01100225 Employee standard roles are assigned to users.
- The roles assigned by default can be defined according to the customer’s requirements in the Standard roles for fast creation of employee template in the Global Settings module.
GermanHolidayImportModule
- Imports German holidays from a web service to PLANTA calendars. For more information, see Calendar.
Parameters | Function |
---|
calendar | ID of the calendar to which you want to import |
start_year | Year from which on you want to import holidays |
end_year | Year up to which you want to import holidays |
state | Federal state for which holidays are to be loaded. Permitted values: HB, NI, NW, HH, SN, MV, BW, SL, SH, ST, BE, RP, BB, BY, HE, TH |
AbsenceImportModule
- Imports absences in the period table
- Since the period table contains one record per day, the imported data is duplicated for each day between start_date and end_date (including start and end date).
- The absence_type column expects a numeric value that can be learned from the table below.
- The values can be inserted using a mapping function like e.g. ConstantValue or Replacer.
Reason for absence | Value |
---|
Absence | 46 |
1/2 day absence | 45 |
Special leave | 48 |
Vacation | 44 |
1/2 day of vacation | 43 |
Maternity leave/parental leave | 47 |
On- and off-the-job training | 113 |
Sickness | 399 |
Parameters | Function |
---|
da_name | See MtsModule |
date_format | The format of the date values in the start_date and end_date columns. For possible values, see the Python documentation |
ConversionFactorImport
Subclass of MtsModule which is able to update data in the conversion factor table.
BasePyRFCModule
Allows to connect to SAP with the new pyrfc library
SAP connection parameters |
---|
ashost |
sysnr |
client |
user |
passwd |
Mapping Functions
Information
- The following mapping functions can be used according to the type.
Enricher
ConstantBoolValue
- Returns the true/false boolean value depending on the configuration
- Input value: is not considered
- Output value: boolean value (true/false)
Parameters | Function |
---|
true | Defines whether true or false is to be returned. Possible values: 0 (false) and 1 (true) |
VariableReader
- Reads the value from an arbitrary variable and returns it
- Input value: not relevant
- Output value: variable content
Parameters | Function |
---|
variable | Variable to be read out, e.g. @1 or @G123. Supports all variable types. |
Slicer
- Enables you to apply the Slice function from Python to a value.
- This can be used in order to cut off parts of the text or to invert the text.
- Input value: text
- Output value: Text
Parameters | Function |
---|
start | Index to begin at |
step | Step width at which to cut off |
end | Index to stop at |
Replacer
- Replaces a value by another one
- Input value: Text
- Output value: text
Parameters | Function |
---|
old_value | Partial string to be replaced |
new_value | Value by which the partial string is to be replaced |
ConstantValue
- Returns a constant value
- Input value: is not considered
- Output value: text
Parameters | Function |
---|
value | By specifying a sign, it will be stripped. If nothing is specified: all types of spaces/tabs |
Stripper
- Cuts off the specified signs before and after a value
Parameters | Function |
---|
chars | The sign that is to be cut off If no sign is specified here, all types of spaces/tabs are cut off. |
LeftStripper
- Cuts off the specified characters at the beginning of a value.
Parameters | Function |
---|
chars | The sign that is to be cut off If no sign is specified here, all types of spaces/tabs are cut off. |
RightStripper
- Cuts off the specified characters at the end of a value.
Parameters | Function |
---|
chars | The sign that is to be cut off If no sign is specified here, all types of spaces/tabs are cut off. |
GetResAssignmentAttribute
- Returns the value of a DI from DT466 and writes a note in the log-file if it could not be found in DT466.
- Input value: is not considered
- Output value: text
Parameters | Function |
---|
project | Technical project ID of the project |
task | Technical task ID of the task |
res_id | Resource ID |
python_id | DI Python ID of the dataitem which is to be returned |
GetPersonId
Concatenator
- Adds the configured string to the input value
- Input value: text
- Output value: text
Parameters | Function |
---|
text | Text which is to be added to the input value |
left | Determines whether the text is to be added on the left of the string; possible values are 0 and 1 |
right | Determines whether the text is to be added on the right of the string; possible values are 0 and 1 |
Rounder
- Rounds the input value to the defined number of digits
- Input value: number
- Output value: text
Parameters | Function |
---|
digits | A number greater/equal to 0; Defines the number of digits to which the input value is to be rounded. If the parameter cannot be converted into any number, the default value 2 will be used. |
GetResourceAttribute
- Returns the value of a DI from DT467 and writes a note in the log-file if it could not be found in DT467.
- Input value: is not considered.
- Output value: text
Parameters | Function |
---|
resource | Resource ID |
python_id | DI Python ID of the dataitem which is to be returned |
LeftPadder
- Extends the entered string on the left by the defined signs and sets the entire string to the defined length
Parameters | Function |
---|
fillchar | Signs by which the string is extended |
width | Entire length of the string with extension |
Example
- Input string: "foo"
- Output string: " foo"
RightPadder
- Extends the entered string on the right by the defined signs and sets the entire string to the defined length
Parameters | Function |
---|
fillchar | Signs by which the string is extended |
width | Entire length of the string with extension |
Example
- Input string "foo"
- Output string: "fooxx"
DataitemReplacer
- Replaces the input value (in case it is empty) with the value of another data item
- Output value: input value (if not empty), otherwise the value of the specified data item
Parameters | Function |
---|
uuid | UUID of the record from which the data item is to be read |
datatable | SQL ID of the data table from which the data item is to be read |
dataitem | SQL ID of the data item to be read |
GetPLANTAIdFromExternalId
- Specifies the PLANTA UUID for the specified ID from an external system, provided that it is linked
- Input value: ID from an external system
- Output value: PLANTA UUID
Parameters | Function |
---|
system | Code of the external system (e.g. 728 for PLANTA pulse) |
type | Object type which has this ID (e.g. 'workload' for loads from PLANTA pulse) |
GetValueFromUuid
- Specifies the value of a data item for a record with the specified UUID
- Input value: PLANTA UUID
- Output value: value of the data item
Parameters | Function |
---|
datatable | SQL ID of the data table from which the data item is to be read |
dataitem | SQL ID of the data item to be read |
GlobalSettingValue
Parameters | Function |
---|
global_setting | ID of the global setting to fetch the alpha120 value from |
GetLDAPDefaultStartPeriod
- Return the start period of the ldap default calendar or today, whichever is later
GetLDAPDefaultEndPeriod
- Return the end period of the ldap default calendar or today in two years, whichever is earlier
Converter
ToUppercase
- Changes a value to UPPER CASE LETTERS
- Input value: text
- Output value: text
ToString
- Changes a value to a text value
- Input value: arbitrary
- Output value: text
ToInt
- Changes a value to an integer
- Input value: arbitrary
- Output value: integer
Parameters | Function |
---|
round | Configures whether the value is to be rounded first |
ToFloat
- Changes a value to a floating point number
- Input value: arbitrary
- Output value: Floating point number
ToList
- Convert a string representation of a list into a list if possible
- Input value: String
- Output value: List
StringToPLANTADate
- Converts a text into the PLANTA date format
- Input value: text
- Output value: integer
PLANTADateToString
- Converts the PLANTA date format into a text
- Input value: integer
- Output value: text
Parameters | Function |
---|
format | Format to be used for the date. For possible values, see the Python documentation |
ConvertFunctionalProjectIDToTechnical
- Has no parameters and takes a functional project ID as a value and returns the technical project ID or None.
ConvertResourceIdToPersonId
- Returns the value of Person ID (DI010420 in DT516) for the code which is passed as a value.
- Input value: a valid Code (DI027020 in DT516)
- Output value: value of the Person ID field (DI010420 in DT516)
ConvertTrailingSignToLeadingSign
- Has no parameters and converts a number, like e.g. 10- to -10
UnicodeNormalizer
- Uses compatible decomposition (NFKD) to convert the special signs that are not shown by PLANTA project into signs that can be displayed by PLANTA project.
Parameters | Function |
---|
encoding | Encoding to which the input text is to be converted. By default, this parameter is preset with the coding of the server and does not have to be changed. |
ConvertPSPtoUUID
- Takes the "project" parameter and converts the passed WBS ID to a UUID.
ConvertValidFromToConversionFactorItemId
- Checks whether there is a record with the transferred date value for the respective conversion factor ID the Valid from value of which corresponds to the date. If it does, the position is returned (DI000343).
Parameters | Function |
---|
conversion_factor_id | Conversion factor ID, saved in DI000341 |
format | Date format for the incoming value (like e.g. PLANTADateToString) |
ConvertDateToYear
- Converts a date into a year.
Parameters | Function |
---|
format | Defines the date format to be passed. |
ConvertProjectToAttribute
- Fetches the value from the configured DI for the specified project
- Input value: Technical project ID
- Output value: text
Parameters | Function |
---|
python_id | The Python ID of the DI from DT461 Project |
ConvertPLANTAUserToPulseUser
- Returns the PLANTA pulse user for a PLANTA project user
- Input value: user code from DT511 (DI010323)
- Output value: PLANTA pulse ID of the user or None
ConvertPLANTAIdToPulseId
- Converts a PLANTA project UUID into a PLANTA pulse ID
- Input value: UUID
- Output value: PLANTA pulse ID of the object or None
ConvertResourceAssignmentUuidToPulseBoardId
- Converts the UUID of a resource assignment into the board ID of the task
- Input value: UUID of a resource assignment (DI060939)
- Output value: board ID of the task
ConvertToJiraField
- Converts the value into a json value which can be processed by Jira
Parameters | Function | Default values |
---|
format | Format of the json value (must contain the '{input}' placeholder) | {'id': '{input}'} |
ConvertSecondsToHours
- Converts seconds into hours and returns them as float
ConvertJiraIdToPLANTAId
- Converts a Jira ID into a PLANTA project UUID
- Input value: ID of a Jira object
Parameters | Function |
---|
type | Type of the external object (as saved in the DT597 ExternalSystemObjectMapping table) |
ConvertUuidToAttribute
- Returns the value of the specified data item of a record with the specified PLANTA project UUID from the specified table
- Input value: UUID of a PLANTA project object
Parameters | Function |
---|
table | SQL ID of a PLANTA project table |
dataitem | SQL ID of a data item from the specified table |
ConvertLDAPIdToPersonId
- Converts a LDAP ID into a PLANTA project Person ID (DI010420 in DT516)
- Input value: ID of an LDAP user account
ConvertPersonIdToCode
- Converts a PLANTA project Person ID (DI010420 in DT516) to their Code (DI027020)
LDAPLockedUserToLeavingDate
- Return today's date if the user account is locked, empty otherwise
Parameters | Function |
---|
object_guid | ID of an LDAP user account |
GetFirstElement
- Return the element at index 0
Validators
- All validators have two parameters:
- child_when_invalid: Here, the name of one of the children of the validator can be entered. If the validator fails, only this child is carried out. If the validator is successful, the
child_when_invalid
string is ignored. - mark_record_as_invalid : If this parameter is at 1, the record is marked as invalid and is not transferred when the validator fails. If the parameter is at 0, only this column is ignored upon transfer.
IsTrue
- Checks whether the value is logically true
ExistsAsPK
- Checks whether the transferred value is a primary key in the configured table
Parameters | Function |
---|
table_num | Table number in PLANTA to be checked |
IsInList
- Checks whether the transferred value is in the configured value list
Parameters | Function |
---|
values | A list of values which must be separated using the configured separator |
separator | Separator for separating the list into separate values |
Equals
Contains
- Checks whether the configured value exists in the transferred value
Parameters | Function |
---|
value | Value to be available |
TaskExists
- Checks whether the transferred value is a valid task ID in the configured project
Parameters | Function |
---|
project | Technical project ID of the project in which is checked |
ResIsAssignedToTask
- Checks whether the transferred value is a valid resource assignment in the configured project and task
- Additionally, the validator can create a resource assignment if none exists.
Parameters | Function |
---|
project | Technical project ID of the project in which is checked |
task | Technical task ID of the task to be checked |
create_if_not_exists | In case the resource assignment does not exist and this parameter is at 1, the resource assignment is created |
ComparesTo
- Compares values. The validator fails if the comparison fails.
- Input value = arbitrary
Parameters | Function |
---|
value | Specifies, against what to compare |
operator | Specifies, how to compare: ==, !=, <, >, <=, >= |
type | Specification of the type, possible values: TEXT, INTEGER and FLOAT. Prior to the comparison, the validator converts the values of the value parameter and the input value into this type. |
YearlyTrancheExists
- Checks whether the passed year is available in the budget of the project as a yearly tranche.
Parameters | Function |
---|
project | Specifies the technical project ID of the project for which the check is to be done. |
cost_type_group | Specifies the cost type group subject to the check. |
create_if_not_exists | Specifies whether the yearly tranche is to be created if it does not exist. Valid values: 1 or 0 |
AlreadyMapped
- Checks whether the ID passed from an external system has already been assigned to a PLANTA project object
Parameters | Function |
---|
external_system | Specifies the ID of the external system |
external_type | Specifies the type of the object from the external system |
IsInCalendar
- Checks whether the transferred date lies within the calendar periods
- Input value: Date string in DD.MM.YY format
Parameters | Function |
---|
calendar_id | Specifies the ID of the calendar |
RemoteExistsAsPK
- Checks whether the supplied primary key exists in the given table
Parameters | Function |
---|
table_num | ID of the table in which to check for the primary key |
pk_id | value of the primary key |
LDAPIsInPersonCircle
- Check if the memberof attribute matches the given person circle
Parameters | Function |
---|
person_circle | ID of the person circle to check |
PersonIsMappedToLDAP
- Check whether the given person ID is mapped to LDAP
System check classes
Parameters | Function |
---|
HostnameConditional | Compares the parameter value to the host name of the application server |
PortConditional | Compares the parameter value to the port entered in globals.conf of the PLANTA server |
WorkDirConditional | Compares the parameter value to the work directory of the PLANTA server |
IPAddressConditional | Compares the parameter value with the IP address of the application server |
Note