Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Note

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 is the list of Lifecycle transition operations available with the Governance API.

 

  1. Associating a Lifecycle to an Artifact
  2. Checking Associated Lifecycle Name of an Artifact
  3. Checking the Current State of the Lifecycle Associated with the Artifact
  4. Get the Checklist Item List
  5. Checking Checklist Item
  6. Checking Whether a Checklist Item is Checked
  7. Unchecking Checklist Item
  8. Get Voting Event List
  9. Voting for an Event
  10. Checking Whether the Current User Already Voted for an Event
  11. Unvoting for an Event, Current User Already Voted
  12. Get all Action List
  13. 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.

 

artifact.attachLifecycle(lifecycleName);

"lifecycleName" is the name of the Lifecycle which artifact need to associate with.

Checking Associated Lifecycle Name of an Artifact

This method is used to get the Lifecycle name of the associated Lifecycle of an artifact.

String lifecycleName = artifact.getLifecycleName();

Checking the Current State of the Lifecycle Associated With the Artifact

This method is used to get the current state of the artifact in its Lifecycle.

String lifecycleState = artifact.getLifecycleState();

Get the Checklist Item List

This method is used to get all the checklist item names of the current state of the associated artifact.

String[] checklistItems = artifact.getAllCheckListItemNames();

Checking Checklist Item

This method is used to check a checklist item on the current state of the associated artifact.

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

This method is used to check whether a checklist item of the current state is clicked or not.

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.

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 invoke.

String[] votingEvents = artifact.getAllVotingItems();

Voting for an Event

This method is used to vote for an event.

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 already voted to an event.

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

This method is used to reverse the vote for an event.

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

This method is used to get all the actions of current Lifecycle state.

artifact.getAllLifecycleActions();

Invoking Actions

These methods are used to invoke an action in the current Lifecycle state.

artifact.invokeAction(action);
artifact.invokeAction(action, parameterMap);

The second method allows to parse a parameter map which can be used in transition executors.

 

  • No labels