How to Delete Skill Definitions

Document ID : KB000021367
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Is there a way to delete existing Skill Definitions? We want to reorganize, delete and create new Skill Definitions within the Skill Hierarchy in Clarity. In Administration > Skill Hierarchy List View I do not see a 'Delete' button. How can we update our Skill Hierarchy?

Solution:

This can be accomplished using XML Open Gateway (XOG). Reference the XOG Documentation for more details.

CAUTION must be taken when using this functionality because it will allow you to delete all current skill associations on resources and roles and delete all skill definitions when using the 'isComplete' tag. Be sure to test your steps in a non-production system to review the outcome of your actions.

In our Example Test Server, we have 2 Skills defined and both skills are associated with Resources and Roles

Administration, Skill Hierarchy List view

Figure 1

Remove Skill Associations from Resources

Before you can remove a Skill Definition, all skill associations on Resources and Roles must be removed.

A Resource or Role Skill Association can be removed directly in the application from the Resource > Skills list view or you can use XOG to remove the skills associations

  1. Create a XOG Read file to read ALL existing resources (this simple code below will give you ALL resources with the <SillAssocs> tag)

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header version="13.0.0.7032" action="read" objectType="resource" externalSource="NIKU">
    </Header>
    </NikuDataBus>

  2. Here is a sample output showing resources with existing skills

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_resource.xsd">
    <Header action="write" externalSource="NIKU" objectType="resource" version="13.0.0.7032"/>
    <Resources>
    <Resource employmentType="EMPLOYEE" externalId=" " includeInDatamart="true" isActive="true" isExternal="false" managerUserName="myuser"
    resourceId="resource01" resourceType="LABOR" username="resource01">
    <PersonalInformation displayName="User, Resource01" emailAddress="resource01" firstName="Resource01" lastName="User"/>
    <CustomInformation>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
    </CustomInformation>
    <General addedBy="myuser" addedDate="2012-06-07"/>
    <OBSAssocs complete="false"/>
    <SkillAssocs>
    <SkillAssoc interestLevel="1 - Low" proficiencyLevel="1 - Beginner" skillCode="skill1" weight="1"/>
    <SkillAssoc interestLevel="1 - Low" proficiencyLevel="1 - Beginner" skillCode="skill2" weight="1"/>
    </SkillAssocs>
    <Calendar baseCalendar="Standard" resetCalendar="false"/>
    </Resource>
    </Resources>
    </NikuDataBus>

  3. Using the output, modify the file to remove the skill associations that will be deleted later - in this example we want to keep 'skill1' and remove 'skill2' from the resource association.

    NOTE: 'isComplete' is case-sensitive and must be entered into the XOG file as 'isComplete'

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_resource.xsd">
    <Header action="write" externalSource="NIKU" objectType="resource" version="13.0.0.7032"/>
    <Resources>
    <Resource employmentType="EMPLOYEE" externalId=" " includeInDatamart="true" isActive="true" isExternal="false" managerUserName="myuser"
    resourceId="resource01" resourceType="LABOR" username="resource01">
    <PersonalInformation displayName="User, Resource01" emailAddress="resource01" firstName="Resource01" lastName="User"/>
    <CustomInformation>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
    </CustomInformation>
    <General addedBy="myuser" addedDate="2012-06-07"/>
    <OBSAssocs complete="false"/>
    <SkillAssocs isComplete="true">
    <SkillAssoc interestLevel="1 - Low" proficiencyLevel="1 - Beginner" skillCode="skill1" weight="1"/>
    </SkillAssocs>
    <Calendar baseCalendar="Standard" resetCalendar="false"/>
    </Resource>
    </Resources>
    </NikuDataBus>

  4. Perform a XOG Write Action with the modified file and see the output success message

    <?xml version="1.0" encoding="UTF-8"?>
    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="resource"/>
    <Status elapsedTime="0.198 seconds" state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="1" updatedRecords="1"/>
    <Records/>
    </XOGOutput>

Remove Skill Associations from Roles

Removing Skill Associations from Roles can be accomplished from within the Clarity application or using XOG.

  1. Create a simple XOG Read file to resource out all existing Roles

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header version="13.0.0.7032" action="read" objectType="role" externalSource="NIKU"/>
    </NikuDataBus>

  2. Here is a sample output showing Resource Roles from our test system

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_role.xsd">
    <Header action="write" externalSource="NIKU" objectType="role" version="13.0.0.7032"/>
    <Roles>
    <Role active="true" availability="8" name="Labor Role 01" parentRole="Labor Parent Role 100" resourceId="labor_role_01" resourceType="LABOR">
    <General addedBy="myuser" addedDate="2012-06-07"/>
    <OBSAssocs complete="false"/>
    <OBSBookingManagerMappings/>
    <SkillAssocs>
    <SkillAssoc interestLevel="1 - Low" proficiencyLevel="1 - Beginner" skillCode="skill1" weight="1"/>
    <SkillAssoc interestLevel="1 - Low" proficiencyLevel="1 - Beginner" skillCode="skill2" weight="1"/>
    </SkillAssocs>
    <CustomInformation>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
    </CustomInformation>
    </Role>
    </Roles>
    </NikuDataBus>

  3. Using the output, modify the file to remove the skill associations that will be deleted later - in this example we want to keep 'skill1' and remove 'skill2' from the Role association.

    NOTE: 'isComplete' is case-sensitive and must be entered into the XOG file as 'isComplete'

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_role.xsd">
    <Header action="write" externalSource="NIKU" objectType="role" version="13.0.0.7032"/>
    <Roles>
    <Role active="true" availability="8" name="Labor Role 01" parentRole="Labor Parent Role 100" resourceId="labor_role_01" resourceType="LABOR">
    <General addedBy="myuser" addedDate="2012-06-07"/>
    <OBSAssocs complete="false"/>
    <OBSBookingManagerMappings/>
    <SkillAssocs isComplete="true">
    <SkillAssoc interestLevel="1 - Low" proficiencyLevel="1 - Beginner" skillCode="skill1" weight="1"/>
    </SkillAssocs>
    <CustomInformation>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
    </CustomInformation>
    </Role>
    </Roles>
    </NikuDataBus>

  4. Perform a XOG Write Action with the modified file and see the output success message

    <?xml version="1.0" encoding="UTF-8"?>
    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="role"/>
    <Status elapsedTime="0.797 seconds" state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="1" updatedRecords="1"/>
    <Records/>
    </XOGOutput>

Remove the Skill Definition

  1. Create a simple XOG Read file to read out all existing Skill Definitions

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/niku/xog/src/webroot/WEB-INF/xog/xsd/nikuxog_read.xsd">
    <Header version="13.0.0.7032" action="read" objectType="skill" externalSource="NIKU">
    </Header>
    </NikuDataBus>

  2. Here is a sample output showing all the Skill Definitions that exist in our test system

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_skill.xsd">
    <Header action="write" externalSource="NIKU" objectType="skill" version="13.0.0.7032"/>
    <skills>
    <skill isActive="true" name="skill2" skillCode="skill2"/>
    <skill isActive="true" name="Skill1" skillCode="skill1"/>
    </skills>
    </NikuDataBus>

  3. Using the output, modify the file to remove the skill definition - in this example we want to keep 'skill1' and remove 'skill2' definition

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_skill.xsd">
    <Header action="write" externalSource="NIKU" objectType="skill" version="13.0.0.7032"/>
    <skills isComplete="true">
    <skill isActive="true" name="Skill1" skillCode="skill1"/>
    <skill isActive="true" name="NewSkill3" skillCode="skill3"/>
    </skills>
    </NikuDataBus>

  4. Perform a XOG Write Action with the modified file and we see the output success message - Note, we want to keep 'skill1' so the warning message is ok

    <?xml version="1.0" encoding="UTF-8"?>
    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="skill"/>
    <Status elapsedTime="0.052 seconds" state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="1" updatedRecords="1"/>
    <Records>
    <Record>
    <KeyInformation/>
    <ErrorInformation>
    <Severity>WARNING</Severity>
    <Description>Old skill with name "Skill1" and code "skill1" is currently associated with (a) resource(s) so can not be deleted when isComplete is true and the skill is missing in the input. </Description>
    </ErrorInformation>
    </Record>
    </Records>
    </XOGOutput>

  5. If an error message appears, it is because there are still some resources or roles with the skill association

    <?xml version="1.0" encoding="UTF-8"?>
    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="skill"/>
    <Status elapsedTime="0.029 seconds" state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="1" updatedRecords="1"/>
    <Records>
    <Record>
    <KeyInformation/>
    <ErrorInformation>
    <Severity>WARNING</Severity>
    <Description>Old skill with name "skill2" and code "skill2" is currently associated with (a) resource(s) so can not be deleted when isComplete is true and the skill is missing in the input. </Description>
    </ErrorInformation>
    </Record>
    <Record>
    <KeyInformation/>
    <ErrorInformation>
    <Severity>WARNING</Severity>
    <Description>Old skill with name "Skill1" and code "skill1" is currently associated with (a) resource(s) so can not be deleted when isComplete is true and the skill is missing in the input. </Description>
    </ErrorInformation>
    </Record>
    </Records>
    </XOGOutput>

After all steps have been completed, we see that 'skill2' was removed and 'NewSkill3' has been added.

Administration > Skills Hierarchy List View

Figure 2