Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleDołączanie dokumentu z archiwum do procesu
linenumberstrue
documentService.attachDocumentToProcess( documentId, documentClassId, "admin", "103_proces1", "103_proces1_zadanie1" );// podajemy id dokumentu i id klasy
documentService.attachDocumentToProcess( wfDocument, "admin", "103_proces1", "103_proces1_zadanie1" );// lub obiekt dokumentu pobrany z archiwum
Code Block
languagejava
titleOdłączenie dokumentu od procesu
linenumberstrue
documentService.detachDocumentFromProcess( doc.getId(), doc.getDocumentClassId(), processId);// podajemy id dokumentu i id klasy
documentService.detachDocumentFromProcess( wfDocument, processId);// lub obiekt dokumentu
Code Block
languagejava
titleOdczytywanie indeksów
linenumberstrue
		WfDocument document = documentService.getDocument( documentId, documentClassId );
        IndexInfo indexInfo1 = document.getIndexByName( "idx1" );//pobieramy indeks po nazwie
        IndexInfo indexInfo2 = document.getIndexById( 1L );//pobieramy indeks po id
        Long id = indexInfo1.getId();// id indeksu
        String name = indexInfo1.getName();// nazwa indeksu
        IndexType type = indexInfo1.getType();// STRING, INTEGER, LIST, DATE, DOUBLE
        Object value = indexInfo1.getValue();// wartość indeksu, typ odpowiedni do IndexType
        
        if ( type == IndexType.DATE )
        {
            Date dateValue = (Date) value;
        }
        else if ( type == IndexType.LONG )
        {
            Long longValue = (Long) value;
        }
        else if ( type == IndexType.DOUBLE )
        {
            Double doubleValue = (Double) value;
        }
        else
        {// STRING lub LIST
            String stringValue = (String) value;
        }
        
        //Fukncje ułatwiajace dostęp do wartości indeksów:
        String stringValue=(String)document.getIndexValue( "idx1" );
        Date dateValue=(Date)document.getIndexValue( 1L );

...

Code Block
languagejava
titleOdczytywanie Zmiana indeksów
linenumberstrue
		 WfDocument document = documentService.getDocument( documentId, documentClassId );
        IndexInfo
indexInfo1 = document.getIndexByName( "idx1" );//pobieramy indeks po nazwie         IndexInfo indexInfo2indexInfo1 = document.getIndexByIdgetIndexByName( 1L"idx1" );// pobieramy indeks po idnazwie
        Long id
= indexInfo1.getId();// id indeksu         String name = indexInfo1.getName();//ustawienie nazwawartości indeksuindeksów
        IndexType type = indexInfo1.getTypesetValue( "abc" );//typ STRING,
INTEGER, LIST, DATE, DOUBLE      document.setIndexValue(   Object value = indexInfo1.getValue()2L,new Date() );//poprzez wartość indeksuid, typ odpowiedniDATE
do IndexType         
        if ( type == IndexType.DATE )
        {
            Date dateValue = (Date) value;
  document.setIndexValue( "idx3",333L );//poprzez nazwę, typ LONG
     }         else if ( type == IndexType.INTEGER )
        {
            Integer intValue = (Integer) value;
        }
        else if ( type == IndexType.DOUBLE )document.setIndexValue("idx4",0.4);//type DOUBLE
         {
            Double doubleValue = (Double) value;
        }
        else
        {// STRING lub LIST
  //Typy wprowadzanych wartości muszą odpowiadać typom indeksów 

        String stringValue = (String) value;
        }
        
        //Fukncje ułatwiajace dostęp do wartości indeksów:
        String stringValue=(String)document.getIndexValue( "idx1" );
        Date dateValue=(Date)document.getIndexValue( 1L );documentService.updateDocument( document );//funkcja zapisuje zmiany w bazie danych


Wyszukiwanie dokumentów

Do wyszukiwania dokumentów należy używać klasy DocumentFinder

...