Is there any rules-engine in Apache ACE to skip UI actions: register target, install distribution?

214 Views Asked by At

Is there any rules-engine I can configure in such a way:

  • register targets that match a filter (targerID=com.acme.ace.test.target.*)
  • install distribution1 to targets that match a filter (targerID=com.acme.ace.test.target.local-*)
  • install distribution2 and 3 to targets that match a filter (targerID=com.acme.ace.test.target.remote-*)
  • and so on
1

There are 1 best solutions below

6
On BEST ANSWER

Associations in Apache ACE allow you to create many to many relations between artifacts, features, distributions and targets using filter expressions.

If you use the Web UI, you create associations whenever you drag and drop between any of the columns. Under the cover, that always creates one to one relationships with filter conditions that are an exact match of the entities involved in the drag and drop.

However, as soon as you start using the GoGo shell or REST API, you can create more powerful associations. Each one has a left and right hand side, and for each side you can specify a filter condition. Those filters are almost exactly like the examples you mention.

An example (run the server-allinone.bndrun from Eclipse) and in the shell type:

w = (cw)

To create a workspace to work with, and then:

$w cd dist-1
$w ct target-1
$w ct target-2

To create a distribution and two targets. And then create an association:

$w cd2t "(name=dist-1)" "(id=target-*)" 1 n

This creates an association between a distribution that matches the first expression and targets that match the second one. The left side can match only one entity, the right side can match 'n' (multiple). Finally:

$w commit

To commit the workspace. If you now log into the Web UI, retrieve the latest version and select 'dist-1' you will see it is associated with both targets. Try adding a third target, also starting with 'target-' and see it is automatically associated as well. Add a fourth target with a different name to confirm that this one is not matched.

Filter conditions, like in OSGi, can also be more complex so you can also use attributes (user defined too, if you want) to create way more complex associations.