Use the same job to loop through multiple origins: Difference between revisions
Jump to navigation
Jump to search
Jkuehlthau (talk | contribs) No edit summary |
Jkuehlthau (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
This example looks at reading from multiple mailboxes for email. Use a variable in the origin connection string. If the job needs to run for another mailbox, it calls the GotoJob function in the “Once After Conn” and pass in the Job's ID. | This example looks at reading from multiple mailboxes for email. Use a variable in the origin connection string. If the job needs to run for another mailbox, it calls the GotoJob function in the “Once After Conn” and pass in the Job's ID. | ||
Once Before Conn | Once Before Conn Before Operation that returns the current Mailbox to process. | ||
<source lang="vb"> | <source lang="vb"> | ||
object ScriptedVariable() | object ScriptedVariable() |
Revision as of 21:10, 12 February 2018
This example looks at reading from multiple mailboxes for email. Use a variable in the origin connection string. If the job needs to run for another mailbox, it calls the GotoJob function in the “Once After Conn” and pass in the Job's ID.
Once Before Conn Before Operation that returns the current Mailbox to process.
object ScriptedVariable() { string mb = Starfish.GetSetting("Mailboxes"); Starfish.LogMessage(runCnt.ToString()); mb = mb.Split(';')[runCnt].Split(',')[0]; mailBox = mb; Starfish.LogMessage("Mailbox: " + mb); return mb; }
Connection String:
@@VAR:vMailbox@@
Once After Conn
void CSharpProcedure() { if (!Starfish.PreviewMode) Starfish.SaveSetting("Mail-LRD-"+mailBox, DateTime.Now.ToString()); string mb = Starfish.GetSetting("Mailboxes"); if (runCnt < mb.Split(';').Length-1) { runCnt++; Starfish.GotoJob("f54baebc-d128-4f9d-9d1a-ac7c88e027fe"); } }