i'm receiving message from a different program. when that program sends message to my current program, i need to save it, so that i can call those messages later. and later i need to send those saved message from my current program to another program where i need to display those messages seperately.
Quote:
quote:
For Example:
PGM-1 --> is the program that sends messages
PGM-2 --> is the program that receives messages from P1 and save it depends upon the Unique ID.
PGM-3 --> is the program that receives message from P2 and displays the message in a screen
CMP-1 and CMP-2 --> Two different computers that runs PGM-1
|
PGM-1 can be run in two different computers (for example: CMP-1 and CMP-2). so PGM-2 receives messages from both CMP-1 and CMP-2 at a time. depend upon the UniqueID we can determine which message belongs to which ID.
When new UniqueID is created by CMP-1 or CMP-2 then a message will be passed to PMG-2 like this "1000,S". so "S - Start" means new Id 1000 created. when i receive a message like "1000,A,0,Coffee", so "A - Add" means added new item for order 1000. when i receive a message like "1000,C", so "C- Closed" means the uniqueID 1000 is done (so no more items will added again to that ID.
if First i receive an Id from CMP-1 as "2000,S" and then received a message as "1500, S" from CMP-2, then Id 2000 should be saved first and then 1500. Id should be saved depends upon the first New ID received by PGM-2. and later if i receive a message like "1500,A,0,Coffee" then need to add that item under ID 1500.
and PGM-3 can display only 2 UniqueID items at a time. and PGM-3 need to display a Closed UniqueId items in screen for 30 seconds. that's why i created PGM-2 to save items.
for example: CMP-1 and CMP-2 send 5 uniqueID items like 400, 500, 100, 300 and 200 to PGM-2 and PGM-2 receives something like this.
Quote:
quote:
<Collection>
<uniqueID ID="400">
<Item id="400" itemno="1" desc="DDDD" />
<Item id="400" itemno="2" desc="EEEE" />
<Item id="400" itemno="3" desc="FFFF" />
<Item id="400" type="C" />
</UniqueID>
<uniqueID ID="500">
<Item id="500" itemno="1" type="A" desc="NNNN" />
<Item id="500" itemno="2" type="A" desc="MMMM" />
<Item id="500" type="C" />
</UniqueID>
<uniqueID ID="100">
<Item id="100" itemno="1" type="A" desc="coffee" />
<Item id="100" itemno="2" type="A" desc="tea" />
<Item id="100" type="C" />
</UniqueID>
<uniqueID ID="300">
<Item id="300" itemno="1" type="A" desc="AAAA" />
<Item id="300" itemno="2" type="A" desc="BBBB" />
'
'
'
(Not closed)
'
'
'
</UniqueID>
<uniqueID ID="200">
<Item id="200" itemno="1" desc="cup" />
<Item id="200" itemno="2" desc="plate" />
<Item id="200" itemno="3" desc="spoon" />
'
'
'
(Not closed)
'
'
'
</UniqueID>
</Collection>
|
so here ID 400, 500 and 100 were closed ones. so when PGM-3 runs, we need to send messages for ID 400 and 500 first to PGM-3. and i need to send the message to PGM-3 as if i receive from PGM-1. for eg: for ID 400, i need to send messages like ("400,s"), ("400,A,1,DDDD"), ("400,A,2,EEEE"), ("400,A,3,FFFF"), ("400,C") to PGM-3. and once both 400 and 500 closed messages were displayed in PGM-3 for 30 seconds i need to send next 2 ID items to PGM-3. ID 100 is closed one, so it can be displayed for 30 seconds and remove from screen. but Id 300 and 200 need to display untill thoses Id's were closed.
so i need to save the received messages seperately under corresponding UniqueId. so that later while i need to send each message received for that ID to PGM-3, i can call that ID and send each messages received for that ID seperately like example 400 sending messages ("400,s"), ("400,A,1,DDDD"), ("400,A,2,EEEE"), ("400,A,3,FFFF"), ("400,C").
Hope you understand what i'm tring to do and that's why i'm tring to add items like this.
if you have any idea please let me know and if you can provide and example then it will be great help for me. please.
Thank in advance.