HP Operations Manager for Windows

OV_Service::AddAntecedentService()
OV_Service::AddAntecedentService_Trans()


boolean AddAntecedentService(
[in] string AntecedentName,
[in, optional] string PropRuleId,
[in, optional] real32 WeightFactor,
[in, optional] sint32 State)
boolean AddAntecedentService_Trans(
[in] string TransId,
[in] string AntecedentName,
[in, optional] string PropRuleId,
[in, optional] real32 WeightFactor,
[in, optional] sint32 State)

Parameters

TransId
Transaction ID returned from OV_Transaction::Start().
AntecedentName
The Name property of the instance of OV_Service on which this service depends. If the service does not exist, the method fails with MDLAPI_E_SERVICE_NOT_EXIST.
PropRuleId
The MsgPropRuleId property of this service dependency. If the propagation rule does not exist, the method fails with MDLAPI_E_PROPRULE_NOT_EXIST. Optional parameter. If this parameter is not set, the default propagation rule is created (MC365). This rule is created because there is no default rule from a Service Type relationship.
WeightFactor
The WeightFactor property value of this service dependency. Optional parameter. Default is 1.
State
The State property value of this service dependency. Optional parameter. Default is Empty.

Calling Convention

These methods can be called only from a WMI instance object.

Description

Adds a dependency relationship between this service and the specified service (instance of OV_Service).

Before dependency is created, verify the following: - Service is already dependent on the specified service. - Specified service is the parent (not just immediately) of this service. - Dependency cycle is detected in the service model. If the service dependecy cycle is detected, the method fails with MDLAPI_E_SVC_DEP_CYCLE_DETECTED.

Return Value

False if the relationship already exists (this service is already dependent on the specified service).

Extended Status Codes

MDLAPI_E_SERVICE_NOT_EXIST
Service does not exist.
MDLAPI_E_SVC_DEP_CYCLE_DETECTED
Specified operation cannot be executed because a service dependency cycle has been detected.
MDLAPI_E_PROPRULE_NOT_EXIST
Message propagation rule does not exist.
MDLAPI_E_PROPRULE_CAPTION_EXIST
Propagation rule with the same Caption already exists.
MDLAPI_E_PROPRULE_SETTINGID_EXISTS
Propagation rule with the same SettingId already exists.
MDLAPI_E_TRANSACTION_NOT_EXIST
Transaction with the specified ID does not exist.