我在注册表中配置了以下自定义生命周期。状态和转换如下所示:
in.design (initial)
-> in.development
-> in.production
-> in.text
in.development
-> in.test
in.test
-> released
released
-> in.production
in.production
-> deprecated
deprecated
-> retired (end)
用例:
工件的批量对帐,在不同的系统中主动管理。
问题: 我需要通过API为某些工件设置“in.production”状态。
我看过以下几种可能性; * GenericArtifact API,我可以使用它将生命周期附加到工件。 =>你不能设置生命周期状态 *“CustomLifecyclesChecklistAdminService”,但它是一个内部API,并且是UI驱动的。很难编程,似乎。
所以问题是: 有没有办法将工件的生命周期状态设置为一个状态,这不是最初的状态?
我自己的答案(有更好的解决方案吗?):
// When "simulating" the behaviour of the UI, the following works. It feels a little awkward and looks brittle to me. Found out how to use it via debugger.
CustomLifecyclesChecklistAdminServiceStub clc = ...
// these are representing the check boxes in the UI
String[] params = { "false", "true", "false" };
clc.invokeAspect(path, lifecycleName, "to.production", params);
答案 0 :(得分:0)
目前' CustomLifecyclesChecklistAdminService'是这样做的方法。但是,状态转换功能将在未来版本中引入治理API [1]。这将提供更清洁的方法。