// end declare accessors public static void checkClassConsistency(ModelRoot modelRoot) { Ooaofooa.log.println( ILogger.OPERATION, "Instance State Machine", //$NON-NLS-1$ " Operation entered: Instance State Machine::checkClassConsistency"); //$NON-NLS-1$ if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$ return; } InstanceStateMachine_c[] objs = InstanceStateMachine_c.InstanceStateMachineInstances(modelRoot, null, false); for (int i = 0; i < objs.length; i++) { objs[i].checkConsistency(); } }
public boolean checkConsistency() { Ooaofooa.log.println( ILogger.OPERATION, "Instance State Machine", //$NON-NLS-1$ " Operation entered: Instance State Machine::checkConsistency"); //$NON-NLS-1$ if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$ return true; } ModelRoot modelRoot = getModelRoot(); boolean retval = true; class InstanceStateMachine_c_test39208_c implements ClassQueryInterface_c { InstanceStateMachine_c_test39208_c(java.util.UUID p39209) { m_p39209 = p39209; } private java.util.UUID m_p39209; public boolean evaluate(Object candidate) { InstanceStateMachine_c selected = (InstanceStateMachine_c) candidate; boolean retval = false; retval = (selected.getSm_id().equals(m_p39209)); return retval; } } InstanceStateMachine_c[] objs39207 = InstanceStateMachine_c.InstanceStateMachineInstances( modelRoot, new InstanceStateMachine_c_test39208_c(getSm_id())); if (((objs39207.length) == 0)) { if (CorePlugin.getDefault().isDebugging()) { Ooaofooa.log.println( ILogger.CONSISTENCY, "Instance State Machine", //$NON-NLS-1$ "Consistency: Object: Instance State Machine: Cardinality of an identifier is zero. " //$NON-NLS-1$ + "Actual Value: " + Integer.toString(objs39207.length)); // $NON-NLS-1$ } else { Exception e = new Exception(); CorePlugin.logError( "Consistency: Object: Instance State Machine: Cardinality of an identifier is zero. " //$NON-NLS-1$ + "Actual Value: " //$NON-NLS-1$ + Integer.toString(objs39207.length), e); } retval = false; } if (((objs39207.length) > 1)) { if (CorePlugin.getDefault().isDebugging()) { Ooaofooa.log.println( ILogger.CONSISTENCY, "Instance State Machine", //$NON-NLS-1$ "Consistency: Object: Instance State Machine: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$ + "Actual Value: " //$NON-NLS-1$ + Integer.toString(objs39207.length) + " SM_ID: " + "Not Printable"); //$NON-NLS-1$ } else { Exception e = new Exception(); CorePlugin.logError( "Consistency: Object: Instance State Machine: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$ + "Actual Value: " //$NON-NLS-1$ + Integer.toString(objs39207.length) + " SM_ID: " + "Not Printable", e); //$NON-NLS-1$ } retval = false; } // Instance State Machine is a subtype in association: rel.Numb = 517 // The supertype class is: State Machine class StateMachine_c_test39213_c implements ClassQueryInterface_c { StateMachine_c_test39213_c(java.util.UUID p39214) { m_p39214 = p39214; } private java.util.UUID m_p39214; public boolean evaluate(Object candidate) { StateMachine_c selected = (StateMachine_c) candidate; boolean retval = false; retval = (selected.getSm_id().equals(m_p39214)); return retval; } } StateMachine_c[] objs39212 = StateMachine_c.StateMachineInstances(modelRoot, new StateMachine_c_test39213_c(getSm_id())); if (((objs39212.length) != 1)) { if (CorePlugin.getDefault().isDebugging()) { Ooaofooa.log.println( ILogger.CONSISTENCY, "Instance State Machine", //$NON-NLS-1$ "Consistency: Object: Instance State Machine: Association: 517: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$ + "Actual Value: " + Integer.toString(objs39212.length)); // $NON-NLS-1$ } else { Exception e = new Exception(); CorePlugin.logError( "Consistency: Object: Instance State Machine: Association: 517: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$ + "Actual Value: " //$NON-NLS-1$ + Integer.toString(objs39212.length), e); } retval = false; } // Instance State Machine is a referring class in association: rel.Numb = 518 // The participating class is: Model Class class ModelClass_c_test39216_c implements ClassQueryInterface_c { ModelClass_c_test39216_c(java.util.UUID p39217) { m_p39217 = p39217; } private java.util.UUID m_p39217; public boolean evaluate(Object candidate) { ModelClass_c selected = (ModelClass_c) candidate; boolean retval = false; retval = (selected.getObj_id().equals(m_p39217)); return retval; } } ModelClass_c[] objs39215 = ModelClass_c.ModelClassInstances(modelRoot, new ModelClass_c_test39216_c(getObj_id())); // The participant is unconditional // The multiplicity of the participant is one if (((objs39215.length) != 1)) { if (CorePlugin.getDefault().isDebugging()) { Ooaofooa.log.println( ILogger.CONSISTENCY, "Instance State Machine", //$NON-NLS-1$ "Consistency: Object: Instance State Machine: Association: 518: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$ + "Actual Value: " //$NON-NLS-1$ + Integer.toString(objs39215.length) + " Obj_ID: " + "Not Printable"); //$NON-NLS-1$ } else { Exception e = new Exception(); CorePlugin.logError( "Consistency: Object: Instance State Machine: Association: 518: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$ + "Actual Value: " //$NON-NLS-1$ + Integer.toString(objs39215.length) + " Obj_ID: " + "Not Printable", e); //$NON-NLS-1$ } retval = false; } return retval; }