Package org.drools.runtime.rule

Examples of org.drools.runtime.rule.FactHandle.toExternalForm()


        //I'm having problems with ObjectStoreWrapper that it's not serializable
        Collection<FactHandle> factHandles = ksession.getFactHandles();
        Assert.assertEquals(1, factHandles.size());
        FactHandle newHandle = factHandles.iterator().next();
        System.out.println("Handle Identity HashCode -> " + newHandle.toExternalForm());
        Assert.assertEquals(handle, newHandle);


    }
View Full Code Here


        ksession.update(atomicFH, value);
        ksession.fireAllRules();
       
        assertEquals( 2,
                list.size() );
        String externalForm = atomicFH.toExternalForm();
       
        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), kbase, null, env);
       
        atomicFH = ksession.execute(CommandFactory.fromExternalFactHandleCommand(externalForm));
       
View Full Code Here

    public FactHandle execute(Context context) {

        WorkingMemoryEntryPoint ep = ((KnowledgeCommandContext) context).getWorkingMemoryEntryPoint();
        FactHandle factHandle = ep.insert(object);

        DisconnectedFactHandle disconectedHandle = new DisconnectedFactHandle(factHandle.toExternalForm());

        if (outIdentifier != null) {
            if (this.returnObject) {
                ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put(this.outIdentifier,
                        object);
View Full Code Here

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext marshallingContext) {
            FactHandle fh = (FactHandle) object;
            writer.startNode( "external-form" );
            writer.setValue( fh.toExternalForm() );
            writer.endNode();
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext unmarshallingContext) {
View Full Code Here

                            HierarchicalStreamWriter writer,
                            MarshallingContext marshallingContext) {
            FactHandle fh = (FactHandle) object;
            //writer.startNode("fact-handle");
            writer.addAttribute( "external-form",
                                 fh.toExternalForm() );
            //writer.endNode();
        }

        public Object unmarshal(HierarchicalStreamReader hierarchicalStreamReader,
                                UnmarshallingContext unmarshallingContext) {
View Full Code Here

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext marshallingContext) {
            FactHandle fh = (FactHandle) object;
            writer.startNode( "external-form" );
            writer.setValue( fh.toExternalForm() );
            writer.endNode();
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext unmarshallingContext) {
View Full Code Here

                      HierarchicalStreamWriter writer,
                      MarshallingContext marshallingContext) {
      FactHandle fh = (FactHandle) object;
      //writer.startNode("fact-handle");
      writer.addAttribute( "external-form",
                           fh.toExternalForm() );
      //writer.endNode();
  }

  public Object unmarshal(HierarchicalStreamReader hierarchicalStreamReader,
                          UnmarshallingContext unmarshallingContext) {
View Full Code Here

    public FactHandle execute(Context context) {

        WorkingMemoryEntryPoint ep = ((KnowledgeCommandContext) context).getWorkingMemoryEntryPoint();
        FactHandle factHandle = ep.insert(object);

        DefaultFactHandle disconectedHandle = new DefaultFactHandle(factHandle.toExternalForm());

        if (outIdentifier != null) {
            if (this.returnObject) {
                ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put(this.outIdentifier,
                        object);
View Full Code Here

                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <get-object out-identifier='outStilton' fact-handle='" + factHandle.toExternalForm() + "' />";
        inXml += "</batch-execution>";
        outXml = template.requestBody( "direct:exec",
                                       inXml,
                                       String.class );
        result = template.requestBody( "direct:unmarshal",
View Full Code Here

                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <retract fact-handle='" + factHandle.toExternalForm() + "' />";
        inXml += "</batch-execution>";
        template.requestBody( "direct:exec",
                              inXml,
                              String.class );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.