code: func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response {
  	var event string // Event entity
  	var eventVal int // State of event
  	var err error
  
  	if len(args) != 3 && len(args) != 4 {
  		return shim.Error("Incorrect number of arguments. Expecting 3 or 4")
  	}
  
  	chainCodeToCall := args[0]
  	event = args[1]
  	eventVal, err = strconv.Atoi(args[2])
  	if err != nil {
  		return shim.Error("Expected integer value for event state change")
  	}
  	channelID := ""
  	if len(args) == 4 {
  		channelID = args[3]
  	}
  
  	if eventVal != 1 {
  		fmt.Printf("Unexpected event. Doing nothing\n")
  		return shim.Success(nil)
  	}
  
  	f := "invoke"
  	invokeArgs := toChaincodeArgs(f, "a", "b", "10")
  	response := stub.InvokeChaincode(chainCodeToCall, invokeArgs, channelID)
  	if response.Status != shim.OK {
  		errStr := fmt.Sprintf("Failed to invoke chaincode. Got error: %s", string(response.Payload))
  		fmt.Printf(errStr)
  		return shim.Error(errStr)
  	}
  
  	fmt.Printf("Invoke chaincode successful. Got response %s", string(response.Payload))
  
  	// Write the event state back to the ledger
  	err = stub.PutState(event, []byte(strconv.Itoa(eventVal)))
  	if err != nil {
  		return shim.Error(err.Error())
  	}
  
  	return response
  }
docs: // Invoke invokes another chaincode - chaincode_example02, upon receipt of an event and changes event state