Info | ||
---|---|---|
| ||
Please follow the documentation on how to create a client-side connection to use the Governance API before following these examples. |
Lifecycle transition operations of the Governance API can be used to do the Lifecycle operation of the artifacts. These operations are available with all artifacts available in Governance Registry like Services, WSDLs, Schemas, Policies, GenericArtifacts and GovernanceArtifacts. Following The following is the list of Lifecycle transition operations available with the Governance API.
- Associating a Lifecycle to an Artifact
- Checking Associated Lifecycle Name of an Artifact
- Checking the Current State of the Lifecycle Associated with the Artifact
- Get the Checklist Item List
- Checking Checklist Item
- Checking Whether a Checklist Item is Checked
- Unchecking Checklist Item
- Get Voting Event List
- Voting for an Event
- Checking Whether the Current User Already Voted for an Event
- Unvoting for an Event, Current User Already Voted
- Get all Action List
- Invoking Actions
Associating a Lifecycle to an Artifact
This method is used to associate a Lifecycle to an artifact. If you want to know about creating a Lifecycle please refer this.
...
See here for more information on Lifecycles and their creation.
Code Block |
---|
artifact.attachLifecycle(lifecycleName); |
"lifecycleName" is the name of the Lifecycle which the artifact need to associate with.
...
Code Block |
---|
artifact.checkLCItem(checkListItemIndex); |
"checkListItemIndex" is the index of the checklist name on the checklist items list returned by the artifact.getLCCheckListItemNames() method.
Checking Whether a Checklist Item is Checked
...
Code Block |
---|
boolean lcItemChecked = artifact.isLCItemChecked(checkListItemIndex); |
"checkListItemIndex" is the index of the checklist name on the checklist items list returned by the artifact.getAllCheckListItemNames() method.
Unchecking Checklist Item
This method is used to reverse a checked check list item of the current state of the associated artifact.
Code Block |
---|
artifact.uncheckLCItem(checkListItemIndex); |
"checkListItemIndex" is the index of the checklist name in the checklist items list returned by artifact.getAllCheckListItemNames() method.
Get Voting Event List
This method is used to get the event list which needs a certain amount of votes before it invokeis invoked.
Code Block |
---|
String[] votingEvents = artifact.getAllVotingItems(); |
...
Code Block |
---|
artifact.vote(eventIndex); |
Here "eventIndex" is the index of the voting event in the voting events list returned by artifact. artifact.getAllVotingItems() method.
Checking Whether the Current User Already Voted for an Event
This method is used to check whether the current user is has already voted to on an event.
Code Block |
---|
boolean currentUserVoted = artifact.isVoted(eventIndex); |
"eventIndex" is the index of the voting event in the voting events list returned by artifact. artifact.getAllVotingItems() method.
Unvoting for an Event, Current User Already Voted
...
Code Block |
---|
artifact.unvote(eventIndex); |
"eventIndex" is the index of the voting event in the voting events list returned by artifact. artifact.getVotingItems() method.
Get all Action List
...
The second method allows to parse a parameter map which can be used in transition executors.
Excerpt | ||
---|---|---|
| ||
Instructions on how to do Lifecycle transitions using the Governance API. |