How to get\to set a workflow state value using OSLC Java API in DNG

How to get\to set a workflow state value using OSLC Java API in DNG

I have a workflow with several states. I’m working with DNG and this applies to the whole
set of requirements of a module.
I need to know how to check the current value of the workflow of a requirement and how to change it.
I can’t find how to do it with the Java OSLC API for DNG.
Is it possible to do this with OSLC API for DNG?

Any suggestions on how to get the value from workflow?

Thanks in advance.

Hi @fbarreno

I have worked with workflow in the RQM, I guess it works similar,

The first step is to get the Creation Factory URI, then to get the Resource Shape of the CF, and finally run a query to the resource shape looking for the oslc:name property with the value hasWorkflowState, this will return a list of properties as oslc:allowedValue, those are the workflow values.

Hopefully works for you.

Regards!

1 Like

How to set a workflow state value using OSLC Java API in DNG

I have a workflow state value. This value is contained in a URI that represents its state value.
How can I update a workflow state value in dooors next generation?

My code:

/…
requirement.getExtendedProperties().put(qname, “http://www.ibm.com/xmlns/rdm/workflowNavantia#Navantia.state.s5”); // Here I can change the state value of my requirement

// But when I try update requirement

// Update the requirement
ClientResponse updateResponse = clientdng.updateResource(requirementLocation,
requirement, OslcMediaType.APPLICATION_RDF_XML);

// I cannot update HTML web jazz DNG

Any suggestions on how to set the value to this a workflow state value?

Thanks in advance.

Hi @fbarreno

Is the requirement object used in the updateResource method an object you have gotten using the getResource method of the OSLC client?, I’m wondering if the requirement object has the ID.

Regards!

– Mario.

Hi @isccarrasco

correct, the requirement has been obtained by means getResource method. Like this:

ClientResponse getResponse = clientdng.getResource(requirementLocation, OslcMediaType.APPLICATION_RDF_XML);
Requirement requirement = getResponse.getEntity(Requirement.class);

/…

my code

…/

requirement.getExtendedProperties().put(qname, “http://www.ibm.com/xmlns/rdm/workflowNavantia#Navantia.state.s5”); // Here I can change the state value of my requirement

// But when I try update requirement

// Update the requirement
ClientResponse updateResponse = clientdng.updateResource(requirementLocation,
requirement, OslcMediaType.APPLICATION_RDF_XML);

I do not it is not work fine. Any suggestions?

Thank in advance,