Versions Compared

Key

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

The business logic for an end point endpoint describes the work that will be done when the end point endpoint executes.  Business logic is defined as a chain of Aptify process flows.  The framework will execute every process flow in the chain.  The only way to abort processing is for your process flow to throw an exception.  You should throw strongly typed exceptions so they can be interpreted by the error handling framework and produce meaningful output to your callers.  

...

Info
titleBusiness Logic Definition properties
Property NameValue

Description

executionTypestring

The value is always '"processFlow".

processFlowPropertiesobjectA process Process flow properties object that describes what process flow to execute (detailed below).
Info
titleProcess Flow Properties object properties
Property NameValueDescription
processFlowNamestringThe name of the process flow in Aptify to execute.
processFlowParametersobjectAn object of key-value pairs. The keys are the input properties defined on the process flows. The values can either be literals, values pulled from the output of other business logic that's executed in this request, or values pulled from input context objects.

...

The above business logic block executes two stock e-Business process flows.  The first one retrieves the cart for the current user , and uses two input context objects.  The second one adds a product to the cart.  It needs an order GE as input.  The 'ensureActiveCart' process flow returns an order GE as an output property named 'outputCurrentOrderGE'.  We reference that order GE with the property value '@parent.ensureActiveCart.outputCurrentOrderGE'.

...

When discussing output entity definitions we said that the framework will only map the last piece of output from the last piece of business logic that executed.  Sometimes the last process flow to execute doesn't return the data you want to return from the end pointendpoint.  The output may exist in another piece of business logic that executed earlier.  A special process flow 'Map Context Property' exists for this situation.  It takes a piece of input and returns it as output.  This allows you to take a piece of output from earlier in the business logic chain and return it as the last piece of output.  You will see examples of this throughout the stock metadata.  

...