You will also have to sync apps which are not published
resource.stream.name.Empty() proprty will hep you to identify unpublished apps.
Unfortunately this will not work for me (or I am too dense to understand how it could work).
My scenario is closer to the "Geographically Dispersed Site" scenario, with the following rules:
- Each geographically distant site is a single node running all services necessary
- Each geographically distant site for legal reasons cannot share their apps and data with other rim nodes
- For the same legal reasons, we cannot provide a common development node for all unpublished apps; therefore the clients may as well develop on the same node as their production (it's very low load)
- We use a sync rule to allow apps to sync to a node only when the app and the node have a matching custom property
The problem is that when a user creates an app locally on their node, it disappears because it doesn't have that custom property set. How can I automatically add this property to their newly created apps? Publish status does not matter to me, really, it's the app owner.
I did try adding the custom property to user accounts in the QMC, and altering the sync rule to check resource.owner.@prop, but that didn't seem to work.
It turns out that I was apparently not creating my sync rule correctly.
We ended up creating a custom property named "SyncKey", which could be set on both nodes, apps and users. Then we created two rules, one to sync based on an app's property and the other to sync based on a user's property. I did two separate rules because I didn't want to risk breaking the one that worked in the first place (the app rule). These could probably be done in a single rule, although now that I think back on it, I think that's what I tried in the first place, and it didn't work. I'd do two separate rules if I were you.
Here's the conditions for the owner based rule
- Resource Filter: App_*
- Conditions: ((node.@SyncKey=resource.owner.@SyncKey))
Here's the conditions for the app based rule
- Resource Filter: App_*
- Conditions: ((node.@SyncKey=resource.@SyncKey))
An example (this example assumes that you have disabled the out-of-the-box sync rule that syncs everything):
Let's say you have a rim node in a branch office. You could create a value in the SyncKey property called "branch", then go set the SyncKey property on that rim node to "branch". If you have apps that you know you want to sync to that location, you can now set that same property to "branch" on those apps, and they (and only they) will sync to the branch rim node. Now, let's say you have a user that you know develops on that node only, and can't get to your central node. You can also set that property on that user to "branch". Boom, any apps owned by that person are ALSO synched to the "branch" node.