Creating a Requirement

Once you have instantiated an OSLC client, you can use the CreateRequirement class to create a new requirement in DOORS Next.

The requirement is to be created in a DOORS Next folder. If the created requirement is to be used only a a specific module, you are recommended to use the Module.getAssetFolder() method to determine the default folder in which to create such artifact. The InsertRequirement class can be used to create add a newly created requirement into a module.

	OslcClient client = OslcClients.jazzForm(new UsernamePasswordCredentials("myUser", "myPassword")).create();
	CreationFactory creationFactory = ...; // creation factory for requirements, as defined by a service provider
	requirement.setTitle("My Requirement ");
	requirement.setPrimaryText("<div xmlns=\"\">This is the text of requirement</b></div>");
	ResourceResponse<Void> response = new CreateRequirement(client, creationFactory.getCreation(), requirement).call();
	System.out.println("URI of the requirement: " + response.getHeaders().getFirst("Location"));

Related concepts

Related tasks
Creating an OSLC client
Using OSLC Configurations
Inserting a Requirement in a Module

Related reference
API Reference