A practical approach shown in the retrieved material is to make the production itself testable, then test components and message flow inside IRIS rather than against live external systems. The main concrete pattern present is:
- enable Testing Enabled on the Production so you can use the built-in test pages for Business Processes and Business Operations during development [1][2]
- start with the Business Operation when building the flow, because that “is convenient to start with the business operation to make testing easier” [1]
- use a local IRIS-backed Business Operation instead of an external dependency when you want isolation, because a BO “can also be used to directly save in IRIS what we want,” and the training example creates a BO that stores the message in the local database rather than calling an external system [2]
- drive the flow with standard request/response message classes extending
Ens.Request/Ens.Response, and let the BO dispatch behavior through itsMessageMapbased on request type [2][3] - validate the orchestration by examining the resulting trace/messages, since the BP example shows testing the BP and then confirming in the trace that it invoked the defined components sequentially and synchronously [4]
So for a full BS → BP → BO integration scenario in an isolated, repeatable way, the closest pattern supported by the returned material is:
- Define request/response message classes for the flow. [2][3]
- Build the BP to orchestrate calls between components. [4]
- Replace external calls with a BO that performs local work in IRIS, such as persisting the request/result to a table, so assertions can be made without depending on outside systems. [2]
- Enable Production testing and use the production test pages for the BP/BO during development. [1][2]
- Verify the end-to-end behavior through the production trace/messages to confirm sequencing and data flow. [4]
The retrieved documents do not describe a formal “mock BO” framework or a dedicated mocking API. What they do show is the substitute-operation pattern: use a real BO with the same interoperability contract, but have it perform deterministic local IRIS work instead of reaching an external system. [2]
Note: BS stands for Business Services, BP for Business Processes, and BO for Business Operations. You need to write ObjectScript in Business Services and Business Operations and can be created in VSCode or Studio. Business Processes can also be made in the Management Portal (see this article for more information on using VSCode). There is no particular order of creation, but the external site to be connected to is a public site and can be used immediately in this sample. In this case, it is convenient to start with the business operation to make testing easier. After creating the components, there are test page in the production for business processes and business operations. However, testing is disabled by default in the production definition to avoid random testing in the production environment. [1]
If you specifically want a documented recommendation for mocking Business Operations, the returned material does not provide that level of guidance. The supported guidance is to keep BOs focused on message handling and adapter/use-flow concerns, and move reusable logic into separate helper/service classes, which also makes it easier to substitute a local BO for tests. [5][3]
Sources:
- Log in to post comments