Package org.openquark.cal.metadata

Examples of org.openquark.cal.metadata.FunctionalAgentMetadata


        // Some of the supplied argument names might be null, but that's OK because
        // the input metadata will automatically use a default name if it's given a null value.
        // NOTE: We want any gems created with names from code or from metadata to consider those names
        //       as NOT being user saved names. This works fine here as a new input name object will be
        //       created with an initial name of whatever we supply.
        FunctionalAgentMetadata metadata = gemEntity.getMetadata(GemCutter.getLocaleFromPreferences());
        ArgumentMetadata[] argMetadata = metadata.getArguments();
        int numNamedArgs = gemEntity.getNNamedArguments();
        CALDocComment caldoc = gemEntity.getFunctionalAgent().getCALDocComment();
       
        for (int i = 0, numInputs = getNInputs(); i < numInputs; i++) {
            PartInput inputPart = getInputPart(i);
View Full Code Here


            return;
        }
       
        // If this was a functional agent, then we need to update its gems on the table top.
        GemEntity entity = getPerspective().getWorkspace().getGemEntity(address.toFeatureName().toQualifiedName());
        FunctionalAgentMetadata metadata = (FunctionalAgentMetadata) NavAddressHelper.getMetadata(this, address.withAllStripped());
        ArgumentMetadata[] argMetadata = metadata.getArguments();
       
        for (final Gem gem : gemCutter.getTableTop().getGemGraph().getGems()) {
           
            if (gem instanceof FunctionalAgentGem) {
               
View Full Code Here

                CALFeatureMetadata metadata = NavAddressHelper.getMetadata(owner, address);
               
                if (metadata instanceof FunctionalAgentMetadata) {

                    boolean failed = false;
                    FunctionalAgentMetadata faMetadata = (FunctionalAgentMetadata) metadata;
                    CALExample[] examples = faMetadata.getExamples();
                   
                    for (int i = 0; i < examples.length; i++) {

                        if (skipNonAutoEvaluableExamples && !examples[i].evaluateExample()) {
                            continue;
                        }
                       
                        StringBuilder result = new StringBuilder();
                        boolean success = EditorHelper.evaluateExpression(owner, examples[i].getExpression(), result);
                       
                        if (!success) {

                            if (!failed) {
                                QualifiedName name = faMetadata.getFeatureName().toQualifiedName();
                                buffer.append (name.getQualifiedName() + " ...\n");
                                failed = true;
                            }
                           
                            examplesFailed++;
View Full Code Here

                CALFeatureMetadata parentFeatureMetadata = getMetadata(owner, parentAddress);
                if (parentFeatureMetadata == null) {
                    return false;
                }
               
                FunctionalAgentMetadata parentMetadata = (FunctionalAgentMetadata)parentFeatureMetadata;
               
                ArgumentMetadata[] arguments = parentMetadata.getArguments();
                arguments[argNum] = (ArgumentMetadata) metadata;
                parentMetadata.setArguments(arguments);
               
                return saveMetadata(owner, parentAddress, parentMetadata);
            }
           
        } else if (method == NavAddress.COLLECTOR_METHOD) {
View Full Code Here

                adjustArgumentNames(owner, address, argMetadata);
               
                return argMetadata[argNum].getDisplayName();
               
            } else {
                FunctionalAgentMetadata parentMetadata = (FunctionalAgentMetadata)getMetadata(owner, address.withAllStripped());
                ArgumentMetadata[] argMetadata = parentMetadata.getArguments();
                adjustArgumentNames(owner, address.withAllStripped(), argMetadata);
               
                return argMetadata[argNum].getDisplayName();
            }
           
View Full Code Here

TOP

Related Classes of org.openquark.cal.metadata.FunctionalAgentMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.