Below you will find descriptions of the process rule parameters (process rule data fields) which are used in standard modules. 

DI041217 Process rule ID

The ID of the process rule is generated automatically upon its creation.

DI041228 Process rule

Name of the process rule which is defined in the Rule DI041230 field

Modifiable

  • in the Process Rules module,
  • provided that the modifying user possesses the required rights

DI041229 Comment

Comment on the process rule

Modifiable

  • in the Process Rules module,
  • provided that the modifying user possesses the required rights

DI057862 Class

Name (incarnation field) of the process rule class. Here, you can define whether the process rule is written in Python or SQL.

Modifiable

  • in the Process Rules module,
  • provided that the modifying user possesses the required rights

Note

DI057966 Object type

Name (incarnation field) of the planning object type. Here, you can define whether the rule is available for projects, ideas, proposals or requests.

Modifiable

  • in the Process Rules module,
  • provided that the modifying user possesses the required rights

Note

DI059086 Rule type

Name (incarnation field) of the rule type. Here, you can define whether the process rule is a process action (e.g. create status report or change project type) or a check rule (e.g. Project manager field is filled).

Modifiable

  • in the Process Rules module,
  • provided that the modifying user possesses the required rights

Details

Note

DI041230 Rule

Here, the process rule by which the completion of the process step is checked is defined.

Modifiable

  • in the Process Rules module,
  • provided that the modifying user possesses the required rights

Information

  • Process rules are provided by the customizer.
  • Rules are SQL statements or Python methods that are performed when a process step is being checked.
    • Process rules with "check rule" rule type can be written with SQL statements or Python methods.
    • Process rules with "action" rule type can only be written with Python methods.
  • For process rules that are written with Python methods, the Rule field is automatically filled with the default lines (initial line, return line and end line) for the particular rule type.
MethodsDefinition
SQL statements
If it is a quantity check of multiple fields on project level, the columns of the select statement must be filled with a placeholder since they are read out from the rule parameters of the process steps.

Example: Check on project check rule. This rule checks columns from the project table on the basis of rule parameters stored in the master data.

  • Select {0} from DT461 WHERE DI001001='{1}'

    Details

    • Placeholder {0} is filled with the rule parameters from the process step master data
    • Placeholder {1} is filled with the current project number

If it is a check on quality or frequency of use, a placeholder must be defined for the search criterion.

Example: UF risks check rule. This rule checks whether risks are already defined for the current project.

  • SELECT count(DI007696) FROM DT810 p WHERE p.DI007696='{0}'
Python method

The "computeProcessRule" method is used for check rules and is handed down to the data item object.

General structure of a check rule:

  • def computeProcessRule(result,di_to_check,object_id,dtp_rec):
    • CONTENT of the method
    • return result
  • di.computeProcessRule = computeProcessRule

 Example: Check on project check rule. This rule checks columns from the project table on the basis of rule parameters specified in the master data.

def computeProcessRule(result,di_to_check,object_id,dtpRec):
	di_list=di_to_check.split(",")
	for attribute in ppms.db_select(ppms.get_query("000357").format(di_to_check,object_id))[0]:
		if attribute in ("",0):
			result+=1
	return result

di.computeProcessRule = computeProcessRule
PY

 Details

  • di_to_check contains the columns of the rule parameter from the process step master data which are to be checked
  • object_id contains the ID of the project to be checked

The "executeProcessAction" method is used for process actions and is inherited by the data item object.

General check rule structure:

  • def executeProcessAction(mts_rec=None,object_id=None):
    • Within this function, various operations can be carried out
      • Such operations are defined individually per rule
      • If an operation is to be used multiple times, it must be made available in a Python module from where it must be started.
    • The function will be made available in the PLANTA Session Dictionary upon execution and be assigned to a module object when the action of the process step is executed in the operative data
    • ppms.get_session_dict()["planta_functions"]=[executeProcessAction]

 Example: Create status report process action:

def executeProcessAction</p>
(mts_rec=None,object_id=None):
	from ppms import create_report
	from ppms import processes
	from ppms import project_rights
	#create report
	mapping_dict=project_rights.get_report_mapping_definition()
	vzh = create_report.Versionizer_helper(mapping_dict["source_dt"], mapping_dict["target_dt"], mapping_dict["data_items"], object_id)

processes.create_report_for_processes(processes.get_object_type_by_pr_id(object_id),object_id,vzh.report_id)
	project_rights.set_report_title(object_id,vzh.report_id)
	return [mts_rec,object_id]

ppms.get_session_dict()["planta_functions"]=[executeProcessAction]
PY

Note

  • Several process rules are already included in the scope of supply of PLANTA project.