I'm confused about the variables $sender and $receiver in Command on Message Receipt .
Would the $sender be Partner AS2 Identifier, and the $receiver be Organization AS2 Identifier?
My test
Organization AS2 Identifier: supplier
Partner AS2 Identifier: tradingpartner
Advanced Settings - Command on Message Receipt
echo "$receiver got a message from $sender"
When I send the message from tradingpartner to supplier, I expect the log would be
supplier got a message from tradingpartner
but I got:
tradingpartner got a message from supplier
Code Trace
The variables are defined at /pyas2/utils.py:
def run_post_receive(message, full_filename):
"""Execute command after successful receive, can be used to call the
edi program for further processing"""
command = message.partner.cmd_receive
if command:
logger.debug(f"Execute post successful receive command {command}")
# Create command template and replace variables in the command
command = Template(command)
variables = {
"filename": os.path.basename(full_filename),
"fullfilename": full_filename,
"sender": message.organization.as2_name,
"receiver": message.partner.as2_name,
"messageid": message.message_id,
}
variables.update(message.as2message.headers)
# Execute the command
os.system(command.safe_substitute(variables))
To swap sender and receiver values would more fit the meaning.
I'm confused about the variables
$sender
and$receiver
in Command on Message Receipt .Would the
$sender
be Partner AS2 Identifier, and the$receiver
be Organization AS2 Identifier?My test
supplier
tradingpartner
Advanced Settings - Command on Message Receipt
When I send the message from
tradingpartner
tosupplier
, I expect the log would bebut I got:
Code Trace
The variables are defined at
/pyas2/utils.py
:To swap
sender
andreceiver
values would more fit the meaning.