Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
fabiorsilva Absent Member.
Absent Member.
317 views

Create and start a execution planning over SOAP API

Jump to solution

Hello.

I am trying to create (and after start) a execution planning over SOAP API, using Java (wsimport from Maven). But I am getting the error: "javax.xml.ws.soap.SOAPFaultException: Property 'PROP_NAME' has no valid value set!" when the method "addNode" is called.

My code:

...
ExecutionNode executionNode = new ExecutionNode();
executionNode.setKind(3); //execution planning kind
executionPlanningService.addNode(sessionId, PROJECT_ID, executionNode, ROOT_NODE_ID);
...

The docs (http://documentation.microfocus.com/silkroot/doc/javadoc/com/microfocus/silkcentral/webservices/executionplanning/ExecutionPlanningService.html) says the following:

 // STEP 4: Now you are ready to create nodes and add them to the execution tree. A node in the execution tree is of the type
 // "ExecutionNode". Define whether you want to add a "Folder" or an "Execution Plan" node by setting the "kind"
 // parameter accordingly (2 = folder, 3 = execution plan) - make sure that the root node still exists.

 int nodeId = executionPlanningService.addNode(sessionId, projects.get(0).getId(), getNewFolder("Folder1", "first folder"), root.getId());
 executionPlanningService.addNode(sessionId, projects.get(0).getId(), getNewExecutionNode("ExecDef1.1", "child execDef", BUILD, VERSION, testContainer.getId()), nodeId);
 nodeId = executionPlanningService.addNode(sessionId, projects.get(0).getId(), getNewExecutionNode("ExecDef1", "first execDef", BUILD, VERSION, testContainer.getId()), root.getId());

 

What are the implemention of "getNewExecutionNode" method? Can you provide a example?

SilkCentral version 18.5.0.19

Thanks!

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

RE: Create and start a execution planning over SOAP API

Jump to solution

Hi fabiorsilva,

 

The error says that the name (PROP_NAME) of the executionNode is not set.

You can check the available properties if you call ExecutionPlanningService getNode.

The method getNewExecutionNode(…) is something your client code has to implement, it could look like below code (of course the propertyInfo should be cached, not reloaded for every call of the method):

 

public static final int KIND_EXECUTIONDEFINITION = 3;

private ExecutionNode getNewExecutionNode(String name, String desc, String build, String version, int testContainerId, int kind) throws WSFaultException {

   String sessionid = getSessionId();

   ExecutionNode node = new ExecutionNode();

   node.setKind(kind);

   List<PropertyValue> properties = new ArrayList<>();

   PropertyValue propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_NAME).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_NAME);

   propertyValue.setName(PROP_NAME);

   propertyValue.setValue(name);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_NAME).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_DESCRIPTION).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_DESCRIPTION);

   propertyValue.setName(PROP_DESCRIPTION);

   propertyValue.setValue(desc);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_DESCRIPTION).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_BUILDNAME).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_BUILDNAME);

   propertyValue.setName(PROP_BUILDNAME);

   propertyValue.setValue(build);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_BUILDNAME).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_VERSIONNAME).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_VERSIONNAME);

   propertyValue.setName(PROP_VERSIONNAME);

   propertyValue.setValue(version);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_VERSIONNAME).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_TESTCONTAINER).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_TESTCONTAINER);

   propertyValue.setName(PROP_TESTCONTAINER);

   propertyValue.setValue(String.valueOf(testContainerId));

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_TESTCONTAINER).getType());

   properties.add(propertyValue);

   if (kind == KIND_EXECUTIONDEFINITION) {

     propertyValue = new PropertyValue();

     propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_PRIORITY).getPropertyTypeId());

     propertyValue.setPropertyID(PROP_PRIORITY);

     propertyValue.setName(PROP_PRIORITY);

     propertyValue.setValue("1");

     propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_PRIORITY).getType());

     properties.add(propertyValue);

   }

   node.getPropertyValues().clear();

   node.getPropertyValues().addAll(properties);

   return node;

 }

 

Regards,

Hubert

3 Replies
Micro Focus Expert
Micro Focus Expert

RE: Create and start a execution planning over SOAP API

Jump to solution

Hi fabiorsilva,

 

The error says that the name (PROP_NAME) of the executionNode is not set.

You can check the available properties if you call ExecutionPlanningService getNode.

The method getNewExecutionNode(…) is something your client code has to implement, it could look like below code (of course the propertyInfo should be cached, not reloaded for every call of the method):

 

public static final int KIND_EXECUTIONDEFINITION = 3;

private ExecutionNode getNewExecutionNode(String name, String desc, String build, String version, int testContainerId, int kind) throws WSFaultException {

   String sessionid = getSessionId();

   ExecutionNode node = new ExecutionNode();

   node.setKind(kind);

   List<PropertyValue> properties = new ArrayList<>();

   PropertyValue propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_NAME).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_NAME);

   propertyValue.setName(PROP_NAME);

   propertyValue.setValue(name);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_NAME).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_DESCRIPTION).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_DESCRIPTION);

   propertyValue.setName(PROP_DESCRIPTION);

   propertyValue.setValue(desc);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_DESCRIPTION).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_BUILDNAME).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_BUILDNAME);

   propertyValue.setName(PROP_BUILDNAME);

   propertyValue.setValue(build);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_BUILDNAME).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_VERSIONNAME).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_VERSIONNAME);

   propertyValue.setName(PROP_VERSIONNAME);

   propertyValue.setValue(version);

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_VERSIONNAME).getType());

   properties.add(propertyValue);

   propertyValue = new PropertyValue();

   propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_TESTCONTAINER).getPropertyTypeId());

   propertyValue.setPropertyID(PROP_TESTCONTAINER);

   propertyValue.setName(PROP_TESTCONTAINER);

   propertyValue.setValue(String.valueOf(testContainerId));

   propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_TESTCONTAINER).getType());

   properties.add(propertyValue);

   if (kind == KIND_EXECUTIONDEFINITION) {

     propertyValue = new PropertyValue();

     propertyValue.setPropertyTypeID(mService.getPropertyInfo(sessionid, kind, PROP_PRIORITY).getPropertyTypeId());

     propertyValue.setPropertyID(PROP_PRIORITY);

     propertyValue.setName(PROP_PRIORITY);

     propertyValue.setValue("1");

     propertyValue.setType(mService.getPropertyInfo(sessionid, kind, PROP_PRIORITY).getType());

     properties.add(propertyValue);

   }

   node.getPropertyValues().clear();

   node.getPropertyValues().addAll(properties);

   return node;

 }

 

Regards,

Hubert

fabiorsilva Absent Member.
Absent Member.

RE: Create and start a execution planning over SOAP API

Jump to solution
Thanks Hubert!

About the last step: how can I assign execution node to planning nodes ?
0 Likes
fabiorsilva Absent Member.
Absent Member.

RE: Create and start a execution planning over SOAP API

Jump to solution
I found a solution. Adding a new properyValue with PROP_ASSIGNED_TESTDEFS with test id value.
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.