createRequest

Purpose

This operation creates a new request in PPM Center.

Function

This operation creates a new request in PPM Center. You can specify the following request contents by using this operation:

  • Simple Fields, defined in request header type, request type, or field group, if applicable

  • Field of Table Component

  • Note

  • URL References

  • Remote References

During this operation, the system applies the rules defined on the request. The field level rules are applied according to the sequence of the fields in the Web service request. Any field value that you enter will override a rule-derived value.

For simple fields defined as budget, benefit, or staffing profile, the field value is the exact name of the budget, benefit, or staffing profile.

Limitations

This operation has the following limitations:

  • Does not support attachment, password field, and references other than URL reference.

  • For chained field change rules, this operation does not perform cascading. For example, a rule defined on a field-A change leads to a field-B change, and another rule is defined to change field-C based on a field-B change. In this example, when you set the value for field-A using this operation, field-B will be changed as result of applying the rule, but field-C will not be affected.

  • For required fields, the request will be created even the value for required field is not specified.

  • There is no security check on the permission. After a user passes authentication, the user can create requests through Web service requests even if the user does not have the 'create request' permission.

  • If the specified token of the field does not exist, there will be no error reported. The field will be simply ignored.

Related Information

Input

The Request object, with all the desired content filled, and with no request ID.

Return

A remote reference to the request.

Java Interface

CreateRequestResponseDocument
createRequest(CreateRequestDocument in)

Parameters

Description

CreateRequestDocument

Wrapper of the request object.

CreateRequestResponseDocument

Wrapper of the remote reference to the newly created request.

Java Examples

Example: create a request of type Mybug, which is a copy of the out-of-box request type Bug, with the following changes:

  • Adding a table component field on the request type:

    Field TOKEN: STAKE_HOLDER

    Number of columns: 2

    Column 1 TOKEN: ID

    Column 2 TOKEN: NAME

  • Adding a auto-complete field on the request type, which allows multi-value

    Field TOKEN: REVIEWER

    Validation: PPM - User Id - Enabled

ExampleCreateRequest

public class ExampleCreateRequest{
. . .
    private void createRequest(String serviceURL, String
requestType) throws Exception {
       // Request component
       Request req = Request.Factory.newInstance();
       req.setRequestType(requestType);
       SimpleField[] fields = new SimpleField[6];
       // simpleFields component
       // Set field 'Description'
       SimpleField field_A = SimpleField.Factory.newInstance();
       field_A.setToken("REQ.DESCRIPTION");
       field_A.setStringValue1Array(new String[] { "WebService
Test" });
       fields[0] = field_A;
       // Set field 'Department'
       SimpleField field_B = SimpleField.Factory.newInstance();
       field_B.setToken("REQ.DEPARTMENT_NAME");
       field_B.setStringValue1Array(new String[] { "Finance"
});
       fields[1] = field_B;
       // Set field 'Module'
       SimpleField field_C = SimpleField.Factory.newInstance();
       field_C.setToken("REQD.VP.MODULE");
       field_C.setStringValue1Array(new String[] { "Module A"
});
       fields[2] = field_C;
       // Set field 'Platform'
       SimpleField field_D = SimpleField.Factory.newInstance();
       field_D.setToken("REQD.VP.PLATFORM");
       field_D.setStringValue1Array(new String[] { "Unix" });
       fields[3] = field_D;
       // Set field 'Impact'
       SimpleField field_E = SimpleField.Factory.newInstance();
       field_E.setToken("REQD.VP.IMPACT");
       field_E.setStringValue1Array(new String[] { "Warning"
});
       fields[4] = field_E;
       // Set field 'Reviewer', which allow multi-values
       SimpleField field_F = SimpleField.Factory.newInstance();
       field_F.setToken("REQD.REVIEWER");
       field_F.setStringValue1Array(new String[] { "admin",
"userx" });
       fields[5] = field_F;
       // Add all the fields to request object
       req.setSimpleFieldsArray(fields);
       // tables component
       Table t = req.addNewTables();
       t.setToken("REQD.STAKE_HOLDER"); // token of the field
       Column c = t.addNewColumns();
       c.setToken("T.STAKE_HOLDER.ID"); // token of the column
       c.setValuesArray(new String[] { "311", "312" }); //
value array
       c = t.addNewColumns();
       c.setToken("T.STAKE_HOLDER.NAME");
       c.setValuesArray(new String[] { "User1", "User2" });
       // notes component
       Note note = req.addNewNotes();
       note.setAuthor("admin");
       note.setContent("WebService Test Note");
       note.setCreationDate(Calendar.getInstance());
       // URLReferences component
       URLReference refURL = req.addNewURLReferences();
       refURL.setAddedBy("admin");
       refURL.setCreationDate(Calendar.getInstance());
       refURL.setDescription("This is a reference created thru
web service");
       refURL.setName("Reference URL");
       refURL.setRefURL("http://www.ref.com");
       // remoteReference component
       RemoteReference ref = req.addNewRemoteReferences();
       ref.setAddedBy("admin");
       ref.setCreationDate(Calendar.getInstance());
       ref.setDescription("This is a reference created thru web
service");
       ref.setName("Ticket#1234");
       ref.setDisplayURL("http://www.display.com");
       Identifier refId = Identifier.Factory.newInstance();
       refId.setId("31234");
       refId.setServerURL("http://server:port");
       ref.setIdentifier(refId);
       ref.setStatus("Assigned");
       // Get web service
       DemandServiceStub stub = new DemandServiceStub(ctx,
serviceURL);
       // Construct message to send
       CreateRequestDocument inDoc =
CreateRequestDocument.Factory.newInstance();
       CreateRequestDocument.CreateRequest createRequest =
inDoc.addNewCreateRequest();
       createRequest.setRequestObj(req);
. . .
}
}      

Errors and Exceptions

Message Code

Message

Cause(s)

Possible Corrective Action

N/A

Missing required element "{http://mercury.com/ppm/dm/1.0}requestType"(line -1, col -1, in SOAP-message)

Missing Request type.

Check and provide the right request type.