BOSS

BOSS+Fundamentals

  • Environment Setup
  • boss module create -m <module1> <pkg1>
  • boss bo create -bo Inv -t ap_invoices_all -m module1 pkg1
  • boss bo create -bo InvLine -t ap_invoice_lines_all -m module1 pkg1
  • boss bo addrelation -m module1 -bo Inv -tbo InvLine -fm invoiceId:invoiceId -c OneToMany -acc lines -macc invoice pkg1
  • boss view create default -m module1  -bo Inv pkg1
    boss view create -m moduleName -bo BusinessObjectName -v viewName <app-package-name>
  • Create transient atributes, mark attributes as sortable, searchable.
  • Deploying 
  • cd pkg1/sources

    vi app-package.json5

    {
      name: "pkg1",
      version: "1.0.0",
      description: "ERPM spectra training app",
      dependencies: { }
    }
  • cd $BOSS_MODEL_HOME/config
  • vi application.json
    [
      {
        "id": "ora_erp_expenses",
        "name": "ERPM spectra training app",
        "version": "1.0.0",
        "description": "ERPM spectra training app",
        "repositories": {
          "factory": "file:///factory"
        },
        "appPackages": {
          "ora_erp_expenses": {
            "repository": "factory",
            "version": "=1.0.0"
          }
        },
        "services": {
          "boss": {
            "version": ">=1.0.0"
          }
        }
      }
    ]
  • boss metadata package -a pkg1 
  • curl -vLk --noproxy "*" -u jack:password -X POST 'http://localhost:8000/api/rwdinfra/apm/v1/applications?force=Enabled' -d @$BOSS_MODEL_HOME/config/application.json
Testing
  • //Open api
    • curl --location --request GET 'http://<host>:<port>/api/boss/data/objects/oraErpExpenses/v1:<deployment_id>/$openapi/expenses' --header 'Authorization: Basic c3VwZXJfdXNlcjp3ZWxjb21lMQ=='
    • http://mumbai242698.bom2.fusionappsdbom1.oraclevcn.com:8000/api/boss/data/objects/module1/v1:1/$openapi/inv
  • //Get Invoices
    • curl --location --request GET 'http://<host>:<port>/api/boss/data/objects/oraErpExpenses/v1:<deployment_id>/expenses' --header 'Authorization: Basic c3VwZXJfdXNlcjp3ZWxjb21lMQ=='
    • http://mumbai242698.bom2.fusionappsdbom1.oraclevcn.com:8000/api/boss/data/objects/module1/v1:1/inv
Define Relationships & Accessors
  • Init Transient Variables In AfterRead Trigger
    • package oraErpExpenses.expense.triggers;
       
      import oracle.boss.script.BeforeReadContext;
      import oracle.boss.script.annotation.BeforeRead;
       
       
      public final class ExpenseBeforeReadTrigger {
       
          @BeforeRead
          public static void beforeRead(final BeforeReadContext context) {
              context.logger().info("In expense.ExpenseBeforeReadTrigger::beforeRead:START");
              context.logger().info("In expense.ExpenseBeforeReadTrigger::beforeRead:END");
          }
      }
    •     expenseTypeName : {
           type : "string",
           accessModifier : "public",
           readable : "public",
           nullable : true,
           creatable : "module",
           updatable : "module",
           fieldSecurityEnabled : false
         },
  • Query over POST is technique through which any fetch request with a complicated filter, sort , paging or shaping criteria including parent & child objects can be formulated as json request body over a POST request, provided we use $query endpoint. The json structure used for QueryOverPost to define the fields/filter/sort/pagination criteria is very similar to how we define Business views . But these are not saved with the rest of the  BO metadata. 

  • Initialise Parameters For NamedViews
  •  
        "expenseId",
        "expenseTypeId",
        "description",
        "location",
        "receiptAmount",
        "receiptCurrencyCode",
        "reimbursableAmount",
        "reimbursementCurrencyCode",
        "expenseDate"
      ],
      accessors: {
        expenseType: {
          fields: [
            "expenseTypeId",
            "name"
          ]
        },
      },
      parameters: {
        formOfPaymentsParam: {
          type: "string"
        },
        expSourceParam: {
          type: "string"
        }
      },
      collection: {
        sortBy: [
          "reimbursableAmount" "desc" } ,
          "expenseDate" "asc" },
          "expenseCategoryCodeOrder""asc"},
          "timeCreated" "desc" }
        ],
        filter : "personId != NULL AND expenseReportId = NULL AND (validationStatusCode=NULL OR validationStatusCode in ('CLEAN')) AND expenseSource='CASH'"
      }
    }

  •  fields : 
  • Define FND Lookup Based LOVs With Translations
  • Uptake Fndlookup Based References For flightclass, flighttype & formOfPayments LOV
  • Enum Based Lists
  • {
      $dt_version : "2310.0.550",
      dataSecurityEnabled : true,
      dataSecurity : {
        rules : [ {
          privilege : "read",
          grants : [ {
            role : "SUPER_USER_ROLE"
          } ]
        }, {
          privilege : "create",
          grants : [ {
            role : "SUPER_USER_ROLE"
          } ]
        }, {
          privilege : "update",
          grants : [ {
            role : "SUPER_USER_ROLE"
          } ]
        } ]
      },
      allowAnonymousAccess : false,
      allowSkipDataSecurityViaAccessor : false,
      faStripeName : "fscm"
    }
  • uidGeneration: "row-id",

  • BeforeRead
  • InitialiseParams
  • Afterread
  • PrepareData
  • Cascade
  • Rollup
  • Validate
  • AfterCommi

  • defaultValue : "0" in EO/VO definition
  • Programmatic -> ExpensePrepareDataTrigger.prepareData




Triggers
  • Read
    • BeforeRead
    • InitializeParameters
    • AfterRead
  • Write
    • PrepareData
    • Cascade
    • Rollup
    • Validate
    • AfterCommit


https://otube.oracle.com/playlist/dedicated/276435163/1_xtrji1q7/1_6y5u8gva





Comments