示例#1
0
        public override int logic(CertifierOrchestrationElement element)
        {
            String handle_id = null;
            String port_id   = null;
            String action_id = null;

            String comp_id     = null;  //action_id or component_id
            String action_oper = null;

            if (typeof(XMLCertifierPrimOper).IsInstanceOfType(element.getElement()))
            {
                XMLCertifierPrimOper start_oper = (XMLCertifierPrimOper)element.getElement();
                handle_id = start_oper.handle_id;
            }


            for (int i = element.getChildren().Count - 1; i >= 0; i--)
            {
                CertifierOrchestrationElement child = element.getChildren()[i];
                if (typeof(XMLCertifierAction).IsInstanceOfType(child.getElement()))
                {
                    XMLCertifierAction certifier_action = (XMLCertifierAction)child.getElement();
                    comp_id   = certifier_action.comp_id;
                    port_id   = certifier_action.port_id;
                    action_id = certifier_action.action_id;
                    //action_oper = certifier_action..value();
                    action_oper = certifier_action.action.ToString();
                }
            }

            if (action_oper.Equals("instantiate"))
            {
                this.instantiateOper(comp_id, handle_id);
            }
            else if (action_oper.Equals("compute"))
            {
                this.computeOper(comp_id, port_id, action_id, handle_id);
            }    /*else if(action_oper.Equals("compute")){
                  *     this.computeOper(subject_id);
                  * }*/
            return(CertifierConstants.NORMAL_SIGNAL);
        }
        public override int logic(CertifierOrchestrationElement element)
        {
            Console.WriteLine(" element children 0 operation " + element.getElement().GetType());

            XMLCertifierAction action      = (XMLCertifierAction)element.getElement();
            String             port_id     = null; // action_id or component_id
            String             action_id   = null; // action_id or component_id
            String             action_oper = null;
            string             comp_id     = null;

            port_id   = action.port_id;
            action_id = action.action_id;

            //action_oper = action..getAction().value();
            action_oper = action.action.ToString();

            /*Console.WriteLine ("passei aqui logic perform action " + action.valueField + action.action_id +
             *      action.action.ToString() + action.oper_name + action.action_idField1 + action.actionField.ToString() +
             *      action.comp_id + action.comp_idField1
             + " action action " + action.action.ToString());*/


            comp_id = action.comp_id;
            Console.WriteLine(" LogicPerformOper port id " + port_id + "action id " + action_id
                              + " comp id " +
                              comp_id + " action oper " +
                              action_oper);

            if (action_oper.Equals("instantiate"))
            {
                this.instatiateOper(comp_id);
            }
            else if (action_oper.Equals("compute"))
            {
                this.computeOper(comp_id, port_id, action_id);
            }     /*else if (action_oper.Equals("compute")) {
                   *    this.computeOper(subject_id);
                   * }*/
            return(CertifierConstants.NORMAL_SIGNAL);
        }