To make Blackberry Mustard, combine blackberries, Dijon mustard, sugar, honey, rosemary, and cayenne in a small saucepan.
Cook over medium heat, stirring and mashing blackberries with the back of a spoon, until mixture comes to a boil.
In a small bowl, mix together vinegar and cornstarch. Add to blackberry mixture. Stir to combine. Let mixture simmer for about 30 seconds and remove from heat.
Spread some butter on 1 side of each piece of bread.
Spread the other side of 4 pieces of bread with blackberry mustard.
Divide the shredded cheese on the non-buttered side of the remaining slices. Top with ham and the blackberry mustard coated slices.
Heat a Panini grill and grill sandwiches one at a time until cheese is melted. Alternately you can use a griddle or nonstick skillet.