def METHOD_NAME(self, dmd, porg):
    # get existing process class
    process_class = None
    for pc in porg.osProcessClasses():
        if pc.id == self.name:
            process_class = pc
            break
    if not process_class:
        process_class = porg.manage_addOSProcessClass(self.name)
    bChanged = False
    includeRegex = process_class.includeRegex
    if process_class.includeRegex != self.includeRegex:
        bChanged = True
        includeRegex = self.includeRegex
    excludeRegex = process_class.excludeRegex
    if process_class.excludeRegex != self.excludeRegex:
        bChanged = True
        excludeRegex = self.excludeRegex
    replaceRegex = process_class.replaceRegex
    if process_class.replaceRegex != self.replaceRegex:
        bChanged = True
        replaceRegex = self.replaceRegex
    replacement = process_class.replacement
    if process_class.replacement != self.replacement:
        bChanged = True
        replacement = self.replacement
    description = process_class.description
    if process_class.description != self.description:
        bChanged = True
        description = self.description
    if bChanged:
        # If something changed, then update the class
        process_class.manage_editOSProcessClass(
            includeRegex=includeRegex,
            excludeRegex=excludeRegex,
            replaceRegex=replaceRegex,
            replacement=replacement,
            description=description)
    self.set_zproperties(process_class)
    # setting zproperties will be overridden if the following parameters are used
    if self.monitor is not None:
        process_class.setZenProperty('zMonitor', self.monitor)
    if self.alert_on_restart is not None:
        process_class.setZenProperty('zAlertOnRestart', self.alert_on_restart)
    if self.fail_severity is not None:
        process_class.setZenProperty('zFailSeverity', int(self.fail_severity))
    if self.modeler_lock is not None:
        process_class.setZenProperty('zModelerLock', self.modeler_lock)
    if self.send_event_when_blocked is not None:
        process_class.setZenProperty('zSendEventWhenBlockedFlag', self.send_event_when_blocked)
    # Flag this as a ZPL managed object, that is, one that should not be
    # exported to objects.xml  (contained objects will also be excluded)
    process_class.zpl_managed = True