Package org.useware.kernel.model.structure

Examples of org.useware.kernel.model.structure.QName


     * @param event
     */
    @Override
    public void onNavigationEvent(NavigationEvent event) {

        QName source = (QName)event.getSource();
        QName target = event.getTarget();

        //System.out.println("Navigate to " + target);

        InteractionUnit targetUnit = dialog.findUnit(target);
        if(targetUnit!=null// local to dialog
        {
            String suffix = target.getSuffix();
            if("prev".equals(suffix) || "next".equals(suffix)) // relative, local (#prev, #next)
            {
                throw new RuntimeException("Relative navigation ot implemented: "+suffix);

                /*if(NavigationEvent.RELATION.next.equals(suffix))
 
View Full Code Here


     *
     * @param event
     */
    @Override
    public void onInteractionEvent(final InteractionEvent event) {
        QName id = event.getId();
        QName source = (QName)event.getSource();

        final Set<Procedure> collection = procedures.get(id);
        Procedure execution = null;

        if(collection!=null)
        {
            for(Procedure consumer : collection) {

                // TODO: This isn't optimal (creation of new resource with every comparison)
                Resource<ResourceType> resource = new Resource<ResourceType>(id, ResourceType.Interaction);
                resource.setSource(source);

                boolean justified = consumer.getJustification() == null
                        || source.equals(consumer.getJustification());

                if(consumer.doesConsume(resource) && justified)
                {
                    execution = consumer;
                    break;
View Full Code Here

     * @param event
     */
    @Override
    public void onNavigationEvent(NavigationEvent event) {

        QName source = (QName)event.getSource();
        QName target = event.getTarget();

        //System.out.println("Navigate to " + target);

        InteractionUnit targetUnit = dialog.findUnit(target);
        if(targetUnit!=null// local to dialog
        {
            String suffix = target.getSuffix();
            if("prev".equals(suffix) || "next".equals(suffix)) // relative, local (#prev, #next)
            {
                throw new RuntimeException("Relative navigation not implemented: "+suffix);

                /*if(NavigationEvent.RELATION.next.equals(suffix))
 
View Full Code Here

            @Override
            public void execute(Dialog dialog, Object data) {

                StatementEvent event = (StatementEvent)data;

                QName sourceId = (QName)event.getSource();
                String key = event.getKey();
                String value = event.getValue();


                if(value!=null)
View Full Code Here

        setCommand(new ModelDrivenCommand() {
            @Override
            public void execute(Dialog dialog, Object data) {

                // activate target unit
                QName targetUnit = (QName)data;

                // 1.) verify activation constraints
                assert getRuntimeAPI().canBeActivated(targetUnit) : "Unit is not activatable: "+ targetUnit;

View Full Code Here

                            );
                        }

                        @Override
                        public void onSystemEvent(SystemEvent event) {
                            QName id = (QName)event.getPayload();

                            Set<Integer> keys = index2child.keySet();
                            for(Integer key : keys)
                            {
                                if(index2child.get(key).equals(id))
View Full Code Here

        Map<QName, ModelNode> descriptions = context.get (ContextKey.MODEL_DESCRIPTIONS);

         // TODO (BUG): After the first reification the behaviour is modified,
        // so the predicate might apply to a dfferent unit. As a result the correllation id is different!

        QName correlationId = interactionUnit.findMapping(MappingType.DMR, new Predicate<DMRMapping>() {
            @Override
            public boolean appliesTo(DMRMapping candidate) {
                return candidate.getAddress()!=null;
            }
        }).getCorrelationId();
View Full Code Here

        assert context.getUnit().doesProduce() : "The unit associated with a command needs to be a producer";

        InteractionUnit<StereoTypes> unit = context.getUnit();
        Resource<ResourceType> output = unit.getOutputs().iterator().next();

        final QName operationRef = new QName(
                output.getSource().getNamespaceURI(),
                output.getSource().getLocalPart(),
                output.getId().getSuffix()
        );
View Full Code Here

            this.widget.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent clickEvent) {

                    QName target = ((Link)interactionUnit).getTarget();

                    NavigationEvent navigationEvent  = new NavigationEvent(
                            CommonQNames.NAVIGATION_ID, target
                    );
View Full Code Here

        Map<QName, ModelNode> descriptions = context.get (ContextKey.MODEL_DESCRIPTIONS);

         // TODO (BUG): After the first reification the behaviour is modified,
        // so the predicate might apply to a dfferent unit. As a result the correllation id is different!

        QName correlationId = interactionUnit.findMapping(MappingType.DMR, new Predicate<DMRMapping>() {
            @Override
            public boolean appliesTo(DMRMapping candidate) {
                return candidate.getAddress()!=null;
            }
        }).getCorrelationId();
View Full Code Here

TOP

Related Classes of org.useware.kernel.model.structure.QName

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.