From Steve:

"Thank you for your great advice, but I don`t still know what javascrip script command can realize the action for copy event, I also wonder if there are same collector case, Can you provide to me a same case, thanks!"

Ah, OK. So the first thing to do is to get you to understand how the Collector does this normally, and then you can figure out how to override that behavior. The default Collector behavior is to react to each inbound Record, process it, and send it as an event. Because this is the most common case by far, most of this is automated by the main Collector loop. Essentially what happens is:

1) Connector passes a new Record to the Collector.
2) Collector calls three parsing methods (defined by you) in turn: preParse(), parse(), and normalize() which are supposed to chop that inbound Record up into little pieces and store the parsed results back into new properties in the original Record.
3) Collector calls 'curEvt.send()' which takes a template event, uses the Rec2Evt map as a guide to map fields from the Record into it, and then sends that as an Event.

The idea here is that all you need to do is define how to parse out the relevant bits from the Record and then how to map those parsed-out values to the Event (using a simple CSV map), and then the Collector takes care of the rest.

In your case, however, the default Collector logic won't work, because you have to split a single input Record into multiple output Events. This means that you have to override the default behavior, and then replicate what the Collector does normally but do it multiple times per Record (potentially).

So here's basically what the Collector does normally:

try {
if (!(rec.customPreparse(curEvt) && rec.preParse(curEvt))) { continue; }
if (!rec.parse(curEvt)) { continue; }
if (!(rec.normalize(curEvt) && rec.customParse(curEvt) && rec.postParse(curEvt))) { continue; }
if (instance.SEND_EVENT) { curEvt.send(); } // Send the event
} catch (err) ....

So, a pretty simple try block which ends with sending the Event IFF the instance.SEND_EVENT flag is set. So the first thing to notice is that you can either just NOT set instance.SEND_EVENT or you can return 'false' from any parsing method to short-circuit this method and NOT use the normal Collector method for sending the event. OK, cool, what about sending it on your own? Well, let's look at the inside of Event.send():

Whoa, this gets pretty complicated! The good news is you don't have to re-create this method, you can just call it yourself directly. But you need to do a couple things to "set up" the environment first. Let's assume that you have an input Record 'rec', you've already parsed out all the relevant strings, and you're left with multiple recipients in the TO field and in the BCC field. So then I imagine you'd do something like this (completely made up):

rec.TOarray = rec.TO.split(",");
rec.BCCarray = rec.BCC.split(",");

rec.curEvtName = "Send E-mail";
for (var recip in rec.TOarray) {
rec.curRecip = recip;

rec.curEvtName = "BCC E-mail";
for (var recip in rec.BCCarray) {
rec.curRecip = recip;
return false;

That's really it. I can't remember offhand if curEvt is actually consumed each time, but you can always do a new Event() if you need to create a new template blank event - I think the risk there is that values from the previous Event would leak into the next one, but since the only thing that's different is the recipient name (and EventName) which will be overwritten, this shouldn't matter.

Oh, also make sure that you have something like:



Does this help?