Class ObjRefAction<T extends Help>

Object
Action
ObjRefAction<T>
All Implemented Interfaces:
Help

public class ObjRefAction<T extends Help> extends Action
This action renews the object references of a partition. It allows the user to schedule the renewal in a Calculation Flow logic.

Use setPartition(), setTypeCode() and setFilter() to select the objects whose references are renewed.

Object references let lookups such as api.customerToRelatedObjectsFilter() find the documents that apply to a customer or a product. Renew them after a change in the customer or product master data, for example when a customer is added to a customer group.

Obtain it with CalculationFlowActionBuilder.addObjRefAction(). The action has no setCalculate() method: adding it starts the renewal. It requests one background job for each object type it renews: Price Records (PR), Contracts (CT) and Rebate Agreements (RBA). If an identical job is still waiting, no new job is added.

Example, renewing the references of Contracts:


 actionBuilder.addObjRefAction()
     .setTypeCode('CT')
 
See Also:
  • Constructor Details

    • ObjRefAction

      public ObjRefAction(T backLink, Invocations<MethodInvocationRecord> invocations)
      Not intended for public use. An action created with this constructor is not added to the Calculation Flow, so it never runs. Use actionBuilder.addObjRefAction() instead.
      See Also:
  • Method Details

    • setPartition

      public ObjRefAction<T> setPartition(String partition)
      Sets the partition that the renewal is meant for. The renewal always runs in the partition of the logic. Outside the system partition, the action renews nothing when you set a different partition.
      Parameters:
      partition - partition the object references will be renewed for.
      Returns:
      this action, for further configuration
    • setTypeCode

      public ObjRefAction<T> setTypeCode(String typeCode)
      Restricts the renewal to one object type: PR, CT or RBA. If you do not set it, all three types are renewed. With any other type code, no job starts.
      Parameters:
      typeCode - type code of domain object the object references will be renewed for.
      Returns:
      this action, for further configuration
    • setFilter

      public ObjRefAction<T> setFilter(Object filter)
      Restricts the renewal to the objects that match a filter. The filter must be a Filter, for example one built with Filter.equal(). With any other object, no job starts. The filter applies to the objects of each type that the action renews.
      Parameters:
      filter - restricts object references renewal to a subset defined by filter.
      Returns:
      this action, for further configuration
    • back

      public T back()
      Returns the builder that added this action, so that the logic can add the next action in the same chain.
      Returns:
      the actionBuilder that added this action
      See Also:
    • getObjectName

      public String getObjectName()
      Not intended for public use.
      Returns:
      the name of the builder that added this action, followed by ".ObjRefAction"
    • getPartition

      public String getPartition()
      Gets the partition set with setPartition(String).
      Returns:
      the partition
    • getTypeCode

      public String getTypeCode()
      Gets the type code set with setTypeCode(String).
      Returns:
      the type code
    • getFilter

      public Object getFilter()
      Gets the filter set with setFilter(Object).
      Returns:
      the filter
    • toString

      public String toString()
      Returns a text representation of this action for debugging.
      Overrides:
      toString in class Object
      Returns:
      a text that contains the partition, the type code and the filter of this action