Transcript:
0:00 [Music]
0:03 hi everyone Patrick from North52 here
0:07 in this video I'm going to demonstrate
0:09 using a for each record function using
0:12 fetch XML instead of using a simple find
0:15 record function like the previous video
0:18 a find records function uses fetch XML
0:22 to visit an entity collection it takes
0:24 at least one parameter the name of the
0:27 fetch XML a query to be executed it can
0:31 also take two additional parameters true
0:34 or false a set no lock on or off and
0:36 finally a function called set params
0:38 which allows you to inject dynamic
0:40 values into your fetch XML a query
0:43 we are going to use this to search for a
0:46 set of failed workflow jobs and then
0:48 execute these jobs again using the norm
0:50 52 scheduler we click settings N52
0:54 formulas and then new we will create a
0:58 formula of type process genie and the
1:00 n52 command entity using the classic
1:03 editor a process genie is the North52
1:06 version of a custom workflow extension
1:09 the process genie will run an agency in
1:11 52 command entity as the workflow that's
1:14 being rerun could be against any entity
1:16 type
1:17 we then saved formula
1:21 the first thing we do is create an
1:23 advanced find to look for these
1:25 workflows in this example we will search
1:28 for failed instances of the test process
1:31 workflow what the workflow actually does
1:33 here is not important as you can use
1:36 this method to rerun almost any failed
1:38 workflow
1:42 we search for workflows that are in our
1:44 failed state where they were created
1:47 today and the name of the system job is
1:50 test process
1:54 next we download for
1:56 xml and open it with either notepad plus
1:59 plus or standard notepad opening it with
2:02 internet explorer can cause some
2:04 difficulties as internet explorer has a
2:06 bad habit of adding additional
2:08 characters that can result in malformed
2:11 xml when copied into dynamics we copy
2:15 the fetch xml open the fetch xml's have
2:18 in our formula and then click +
2:21 we paste it in fetch XML into the bottom
2:24 window and then set a name for the fetch
2:27 XML in this case we would call it find
2:30 failed test workflows before we save the
2:34 record we would make one change we
2:36 remove the value from name and instead
2:39 replace it with open curly bracket zero
2:42 chose curly bracket this will allow us
2:44 to inject the name dynamically into the
2:47 fetch XML when it is being run using the
2:49 separate function
2:53 save the fetch XML and then return to
2:56 the formula this formula will use a
2:58 simple for each record function but this
3:01 time we will use a find records FD we
3:04 click on the snippets drop-down and
3:05 select for each record delete the
3:09 samples find records and click on the
3:11 functions tab hold on the shift key and
3:14 click on the find records FD function
3:17 name this will bring up the function
3:19 wizard we open the fetch XML tab on the
3:22 left hand side and click the name and
3:24 then click generate this adds the basic
3:27 syntax for a find records FD function to
3:30 the formula what we also need to add the
3:32 set params this is what we will use to
3:35 inject the name interface XML the first
3:39 value entered is injected at the zero
3:41 slot second at the one side etc you can
3:45 add as many as you need in this example
3:47 we are only injecting the name of the
3:49 workflow we want to find test workflow
3:53 when the forage record executes it will
3:56 generate a collection of these failed
3:58 workflows we then delete the default
4:00 value that was added by the snippet next
4:04 we need to rerun the workflow so we use
4:07 the Excel workflow function we search
4:09 for XV workflow in the functions tab
4:11 along the shift key and click on the
4:13 name this will bring up the wizard
4:15 execute workflow takes two parameters
4:18 the name of the workflow we want to run
4:20 and the good of the work or we want to
4:22 run the workflow against we will use the
4:25 recording object ID from the failed
4:27 workflows as the target in three good
4:29 this will be the current record
4:31 regarding object ID and we select the
4:34 work we want to be run from the drop
4:36 down we then close a for each record and
4:40 save the formula make sure to keep a
4:43 record of the formula short code you
4:45 will need that for a global action
4:48 the next step is to create a new process
4:51 of type of global action we will call it
4:54 retry failed workflows there is a bug
4:57 with how Microsoft executed the fetch
4:58 XML at runtime to look up the unique
5:01 name of an action so we use a workaround
5:03 for this by copying the end of the
5:06 unique name into the workflow name
5:13 we will add just one step to this action
5:15 and North52 process Cheney Cola we
5:19 paste in the shortcode from the formula
5:21 so the process Ernie knows which format
5:24 to call in this case PHS we had saved
5:28 and then we activate the workflow
5:35 the last step is to set up the shirt
5:38 keep this action we navigate the
5:40 settings N52 schedules and then open
5:43 a new schedule set the schedule name in
5:46 this example I'm going to use nightly
5:50 retry of failed test workflows next we
5:54 set the frequency of the schedule how
5:56 often you wanted to run in this example
5:59 we are going to use daily change the
6:03 schedule type the global action and then
6:06 select the process we previously just
6:08 created
6:10 we don't want to execute this during
6:12 working hours so we set the start time
6:15 to be tonight at 11 p.m. and then click
6:17 Save finally we click on n52 commands
6:20 start schedule now at 11 p.m. each day
6:24 this schedule will trigger the global
6:27 action retry of failed workflows this
6:30 will then trigger the formula which will
6:32 create the collection of all the failed
6:34 workflows of that name and then execute
6:36 them thank you for watching in this
6:39 video we covered using fetch XML you
6:42 know for each record setting of a
6:44 process genie and configuring a basic
6:46 scheduler if you have any questions or
6:49 need any assistance with anything you
6:50 saw in this video please contact support
6:52 at Noor 52 comm or visit
6:55 support.norton.com
