A Hyperledger Composer business network definition is composed of a set of model files and a set of scripts. The scripts may contain transaction processor functions that implement the transactions defined in the business network definition's model files.
Here's an example of a script file with a transaction:
Sample transaction processor function. * @param {org.example.basic.SampleTransaction} tx The sample transaction instance. * @transaction */ async function sampleExchange(tx) { // Get the asset registry for the asset. const assetRegistry = await getAssetRegistry('org.example.basic.SampleAsset'); //Ensure the balance is greather than the amount to be transfered if(tx.origin.value > tx.txTransferAmount) ...