4 Replies Latest reply: May 25, 2012 12:34 PM by Frank.Hampshire-Oracle RSS

    OPA 10.4 - batch processor and Entity

    934470
      Hello all.

      I have a problem with the use of Entity with batch processor.

      The fact is we want to use OPA with csv input named like "TARIF_ONE.csv". One different csv for every way of tarification and each time a different project that will be call by a batch process (the client need)... without the use of a configuration file !

      So, if I well understood the OPA batching process, I need, for a "TARIF_ONE" project to be feed with a "TARIF_ONE.csv" file, to have a "TARIF_ONE" entity that will get all the data from the csv input file.

      I've done so.

      But my problem is that when I call the OPA zip by batch, the TARIF_ONE entity are well feed by the data from the csv file... but the calculation from the excel file are not made at all... and in a exporttsc file, the Entities (TARIF_ONE) are set as "unknown" for all the cases inputed...

      I've setted my project like this :

      my Properties file is setted like that :
      Global
      - TARIF_ONE (entity)
      --- INPUT_DATA_ONE (attribute) : Text = "Input data one"
      --- INPUT_DATA_TWO (attribute) : Text = "Input data two"
      --- ...
      --- OUTPUT_DATA_ONE (attribute) : Text = "Output data one"
      --- OUTPUT_DATA_TWO (attribute) : Text = "Output data two"

      And my excel rules file is setted like below

      - Declaration Sheet
      -- INPUT_DATA_ONE : Text = "Input data one from TARIF_ONE"
      -- INPUT_DATA_TWO : Text = "Input data two from TARIF_ONE"
      -- ...
      -- OUTPUT_DATA_ONE : Text = "Output data one from TARIF_ONE"
      -- OUTPUT_DATA_TWO : Text = "Output data two from TARIF_ONE"

      - Calculation Sheet
      -- OUTPUT_DATA_ONE = INPUT_DATA_ONE * INPUT_DATA_TWO
      -- ...

      As I said, when using the batch process, the inputs attribute for the TARIF_ONE entity are well feed, but the OUTPUT attribute are not (still unknown)... and the Entity itself is said as "Unknown"... any way of reflexion to soluce that ?

      Thank-you,

      Philippe,
        • 1. Re: OPA 10.4 - batch processor and Entity
          934470
          Okay !

          I've found the pbm : The input file had not the PUBLIC_NAME of my OUTPUT attribute from my Entity... so the batch processor couldn't find where to put the result of the OPA calculation.
          Replacing the "(the_output_data_one)" field by a "(OUTPUT_DATA_ONE)" field in my input csv file answer the pbm.


          I'm a little bit confused now :(


          lol... ^^ See you !

          Edited by: Philippe Carpentier on 24 mai 2012 08:26
          • 2. Re: OPA 10.4 - batch processor and Entity
            Frank.Hampshire-Oracle
            When using the zero-configuration options, you should always use a public name for the attributes you want to appear and parenthesis "(...)" to indicate that this field is an outcome.

            You can use explicit configuration to avoid confusion, although this is more work, it makes it clear what to expect for input and output.

            For more information, see Configure the Batch Processor in the Oracle Policy Automation Developer's Guide available from the OPA install or, at http://docs.oracle.com/html/E29403_01/toc.htm
            • 3. Re: OPA 10.4 - batch processor and Entity
              934470
              Thank you Franck for your answer.

              I would have just one more question : is it possible to use different entity in the zero configuration mode ?

              I tried with one data file by entity, and the entities ares not created
              I tried with all the datas for entities in the global.csv file, and the same.

              It seams to me that when using differents entities in a projetc for batch, we have to use a configuration file... do you confirm my feeling ?

              Philippe,

              Edited by: Philippe Carpentier on 25 mai 2012 03:12
              • 4. Re: OPA 10.4 - batch processor and Entity
                Frank.Hampshire-Oracle
                Philippe Carpentier wrote:
                Thank you Franck for your answer.

                I would have just one more question : is it possible to use different entity in the zero configuration mode ?

                I tried with one data file by entity, and the entities ares not created
                I tried with all the datas for entities in the global.csv file, and the same.

                It seams to me that when using differents entities in a projetc for batch, we have to use a configuration file... do you confirm my feeling ?

                Philippe,

                Edited by: Philippe Carpentier on 25 mai 2012 03:12
                You can definitely load entities other than global using zero configuratiuon. To do this create a csv file that has the same name as the public name of your entity. For example if you have an entity with the name "person" then create a person.csv file for each entity instance.

                You will need to have a reference to which global instance each entity instance relates to. The way to do this is to have a column named for the containment relationship for the entity to hold the foreign key to the entity instances parent.

                Example

                We have a global.csv with 3 globals (3 cases)
                #, (number_of_persons)
                1,
                2,
                3,
                And then a person.csv with 7 people which must all be link to their owning (parent) global. This is done through the containment relationship with the public name "all_persons"
                #,person_name,person_age,all_persons
                1,Fred,      ,27,       ,1
                2,Barney,    ,28,       ,1
                3,Homer,     ,40,       ,2
                4,Marge,     ,38,       ,2
                5,Bart,      ,10,       ,3
                6,Maggie,    ,1,        ,3
                7,Lisa,      ,8,        ,3
                Each value in the column "all_persons" is a foreign key to the global value which contains that person

                For more information on this, see "CSV input for the Batch Processor", and "Zero-configuration conventions for CSV input" in the "Oracle Policy Automation Developer's Guide". http://docs.oracle.com/html/E29403_01/toc.htm