createSkills

Purpose

This operation creates multiple new skills in PPM Center.

Function and Parameters

This operation returns zero or more skill reference objects from PPM Center according to a specified list of (maximum 1,000) skill beans to create skills. The user performing this operation must have the following access grant:

  • Edit All Skills

Required Fields:

  • Name

  • Enabled

Optional Fields:

  • Description

  • ID

  • category

Limitations

This operation has the following limitations:

  • Maximum 1,000 skills can be created in a single invocation.

  • Creation of skills using this operation occur in one single transaction and as an atomic operation. If the creation of one skill fails, the whole operation is rolled back.

Input

An array of Skill.

Return

An array of SkillReference.

Java Interface

CreateSkillsResponseDocument createSkills(CreateSkillsDocument in)

Parameters

Description

CreateSkillsDocument

Wrapper array of skill bean. (SkillBean[])

CreateSkillsResponseDocument

Wrapper for the skill reference array. (SkillReference [])

Java Examples

Example: create new skills.

public static void main(String[] args) throws Exception {
        // check parameter
        if (args.length < 1) {
            System.out.println("Usage: java
ResourceServiceClient <service URL> [<true/false>]");
            System.exit(1);
        }
        System.out.println("Starting Resource Service
tests...");
        ResourceServiceClient rm = new ResourceServiceClient();
        rm.WSURL = args[0];
        if (args.length > 1 && args[1].equalsIgnoreCase("true"))
{
             rm.DEBUG = true;
         }
         System.out.println("Test create skill ...");
       Skill skill = Skill.Factory.newInstance();
           skill.setName("Test Skill " +
System.currentTimeMillis());
          skill.setDescription("Test Skill");
          skill.setEnabled(true);
          SkillReference[] skillReferences = createSkills(new
Skill[]{skill});
         System.out.println("Resource Service tests complete.");
     }
SkillReference[] createSkills(Skill[] skills) throws Exception
{
    ResourceServiceStub service = new ResourceServiceStub(ctx,
RESOURCE_SERVICE);
    CreateSkillsDocument createSkillsDoc =
CreateSkillsDocument.Factory.newInstance();
    createSkillsDoc.addNewCreateSkills().setSkillArray(skills);
    CreateSkillsResponseDocument responseDocCreate =
service.createSkills(createSkillsDoc);
    CreateSkillsResponse responseCreate =
responseDocCreate.getCreateSkillsResponse();
    debugPrint(responseCreate, "create response");
    return responseCreate.getSkillRefArray();
}

Errors and Exceptions

When an error occurs with this operation, you will see a description of the root cause in the log or in the response message.

The server log file content is similar to the following:

Exception in thread "main" org.apache.axis2.AxisFault:
<exception:exceptionDetails xmlns:exception="http://
www.mercury.com/ppm/ws/exception">
<exception:detail>[root cause description] </exception:detail>
</exception:exceptionDetails>

Possible root cause descriptions:

Message Code

Message

Cause(s)

Possible Corrective Action

error.ws.maxSkills

The maximum number of skills to process in a single web service transaction may not exceed 1000.

The skill list has more than 1,000 skills.

Break up the list into smaller chunks and process over multiple transactions.

error.duplicateName

A skill with the name "{0}" already exists. Enter a different name.

The skill of the name is duplicated with an existing one.

Enter a different name.

error.ws.nameRequiredSkill

Name cannot be blank. Provide a name for each skill.

At least one of the skills does not have a name.

Ensure all skills have a name.

error.ws.descriptionTooLong

Description cannot be longer than 650 characters.

The description of a skill is more than 650 characters.

Reduce length of description.

error.ws.nameTooLong

Name cannot be longer than 260 characters.

The name of a skill is great than 260.

Reduce length of name