Clarity

  • 1.  Reassign Action Items using Gel Script

    Posted Oct 25, 2010 07:52 AM
    Hi All,


    I am trying to reassign action items using GEL Script in a process.

    I am able to reassign action items to other users but once the action item is reassigned, the action taken by new assignee is not reflected/captured by the process to proceed.

    Can anyone help me on this.

    Thanks in Advance for your help on this.


  • 2.  RE: Reassign Action Items using Gel Script
    Best Answer

    Posted Oct 25, 2010 09:15 AM
    Hi,

    How you re-assigned the action items by using GEL Script. If update the re-assignee details in CAL_ACTION_ITEM_ASSIGNEES table, user can see the action items but can't see the re-assignee user details in process. you have to update assignee user to BPM_RUN_ASSIHNEES.

    if you need sample update script, i will forward to you.

    I have done this kind of activity for one of my client.


    Thanks
    Senthil


  • 3.  RE: Reassign Action Items using Gel Script

    Posted Oct 25, 2010 11:25 AM
    Can you please send the script..

    Thank you


  • 4.  RE: Reassign Action Items using Gel Script

    Posted Oct 27, 2010 08:14 AM
    Hi Senthi,
    i would also love to see how that is done.
    if you want to share please email to fpena@itroisolutions.com

    thanks
    Federico


  • 5.  RE: Reassign Action Items using Gel Script

    Posted Nov 05, 2010 02:25 PM
    Hi senthi,

    Could you please send me the sample code. I need to do similar requirement

    Thanks in advance


  • 6.  RE: Reassign Action Items using Gel Script

    Posted Nov 11, 2010 02:31 AM
    Hi,

    If you re-assign the action items to some one by using gel script, it's more complicated. You can re-assign the action items to some one with out using the process, just update at database level. even also it's very simple.

    if you want i will share the approved action items / re-assign action items script which i used, to bulk approved the resource requisitions at database level.


    Thanks
    Senthil


  • 7.  RE: Reassign Action Items using Gel Script

    Posted Nov 11, 2010 02:26 PM
    My requirement is actually as below,

    My manager would pass the action item ID,Assignee and then whom to assign the action item.

    Now I need to take these 3 parameters in my query and assign the action item to the person as mention in parameter


    Kindly let me know if you dint understand

    thank you


  • 8.  RE: Reassign Action Items using Gel Script

    Posted Dec 09, 2010 03:08 PM
    Hello Senthi,
    Could you please send me the data base script for action-reassignment.
    Please help me addressing this issue.
    I have been trying all possible ways but could not meet the requirement

    Thanks in advance


  • 9.  RE: Reassign Action Items using Gel Script

    Posted Dec 26, 2010 12:45 AM
    Hi,

    I created the sampe process which need to re-assigned the action items. please follow the following steps, to configure the process.


    1. To create a temp table.

    CREATE TABLE AMD_REAGN_ACTION_ITEM (REQUISITION_CODE VARCHAR(100), PROCESS_STEP_NAME VARCHAR(100),
    REASSIGNEE_USER_NAME VARCHAR(50))


    2. Insert data to temp table with contents of "Requisition Code", "Process Step Name (Manual Action Item Name)" & "Reassignee User Name"

    3. To create a process

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_bpm_process.xsd">
    <Header action="write" externalSource="NIKU"
    objectType="bpm_process" version="12.1.0.5840"/>
    <Processes>
    <Process allowOneRunningInstance="false"
    code="reassgn_action_item" createdBy="admin"
    endStep="Finish" source="customer" startOption="ON_DEMAND" startStep="Start">
    <nls description="Re-Assign Action Item Process"
    languageCode="cs" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="da" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="de" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="en" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="es" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="fi" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="fr" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="it" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="ja" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="ko" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="nl" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="no" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="pt" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="sv" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="zh" name="Re-Assign Action Item Process"/>
    <nls description="Re-Assign Action Item Process"
    languageCode="zh_TW" name="Re-Assign Action Item Process"/>
    <Security>
    <UserSecurity rightCode="PROCESS-DEF-INST-INITIATE" userName="admin"/>
    <UserSecurity rightCode="PROCESS-DEF-INST-WRITE" userName="admin"/>
    </Security>
    <Objects>
    <Object manualStart="false" name="thisXmlDocument"
    objectType="xml_document" partitionCode="NIKU.ROOT"
    partitionModeCode="PARTITION_ONLY" type="BPM_POT_PRIMARY"/>
    </Objects>
    <Steps>
    <Step id="Start" isMileStone="false" sequenceNo="1">
    <nls languageCode="cs" name="Start"/>
    <nls languageCode="da" name="Start"/>
    <nls languageCode="de" name="Start"/>
    <nls languageCode="en" name="Start"/>
    <nls languageCode="es" name="Start"/>
    <nls languageCode="fi" name="Start"/>
    <nls languageCode="fr" name="Start"/>
    <nls languageCode="it" name="Start"/>
    <nls languageCode="ja" name="Start"/>
    <nls languageCode="ko" name="Start"/>
    <nls languageCode="nl" name="Start"/>
    <nls languageCode="no" name="Start"/>
    <nls languageCode="pt" name="Start"/>
    <nls languageCode="sv" name="Start"/>
    <nls languageCode="zh" name="Start"/>
    <nls languageCode="zh_TW" name="Start"/>
    <Notifications notifyOwner="false">
    <NotifyWhen stepCompleted="false"
    stepInError="false" stepStarted="false"/>
    <Assignees/>
    </Notifications>
    <Operations>
    <Action code="reasgn_action_items"
    synchronized="true" type="BPM_SAT_CUSTOM">
    <nls languageCode="cs" name="Reassign Action Items"/>
    <nls languageCode="da" name="Reassign Action Items"/>
    <nls languageCode="de" name="Reassign Action Items"/>
    <nls languageCode="en" name="Reassign Action Items"/>
    <nls languageCode="es" name="Reassign Action Items"/>
    <nls languageCode="fi" name="Reassign Action Items"/>
    <nls languageCode="fr" name="Reassign Action Items"/>
    <nls languageCode="it" name="Reassign Action Items"/>
    <nls languageCode="ja" name="Reassign Action Items"/>
    <nls languageCode="ko" name="Reassign Action Items"/>
    <nls languageCode="nl" name="Reassign Action Items"/>
    <nls languageCode="no" name="Reassign Action Items"/>
    <nls languageCode="pt" name="Reassign Action Items"/>
    <nls languageCode="sv" name="Reassign Action Items"/>
    <nls languageCode="zh" name="Reassign Action Items"/>
    <nls languageCode="zh_TW" name="Reassign Action Items"/>
    <customScript languageCode="gel">
    <scriptText>
    <gel:script xmlns:core="jelly:core"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:jelly="jelly:email" xmlns:sql="jelly:sql">
    <!-- Set the Defug Mode -->
    <gel:parameter default="1" var="debug"/>
    <core:if test="${debug}">
    <gel:log level="INFO">Gel Process Started</gel:log>
    </core:if>
    <!-- Verify a connection with the database -->
    <core:catch var="errorVar">
    <gel:setDataSource dbId="Niku"/>
    </core:catch>
    <core:choose>
    <core:when test="${errorVar == null}">
    <sql:query var="dual">select 1 from dual</sql:query>
    <core:if test="${debug}">
    <gel:log level="INFO">Database connection established</gel:log>
    </core:if>
    </core:when>
    <core:otherwise>
    <gel:log level="ERROR">Database connection NOT established</gel:log>
    </core:otherwise>
    </core:choose>
    <sql:query var="v_qryresult">










    SELECT REQUISITION_CODE,PROCESS_STEP_NAME,REASSIGNEE_USER_NAME FROM AMD_REAGN_ACTION_ITEM









    </sql:query>
    <core:forEach
    items="${v_qryresult.rowsByIndex}"
    trim="true" var="v_row">
    <core:set
    value="${v_row[0]}" var="REQUISITION_CODE"/>
    <core:set
    value="${v_row[1]}" var="PROCESS_STEP_NAME"/>
    <core:set
    value="${v_row[2]}" var="REASSIGNEE_USER_NAME"/>
    <sql:update>


    UPDATE BPM_RUN_ASSIGNEES SET USER_ID=(SELECT ID FROM CMN_SEC_USERS WHERE USER_NAME ='${REASSIGNEE_USER_NAME}') WHERE ID = (



    SELECT ASSIGNEES.ID FROM BPM_RUN_STEPS STEP JOIN BPM_DEF_STEPS DEF_STEP ON STEP.STEP_ID = DEF_STEP.ID JOIN CMN_CAPTIONS_NLS CC



    ON DEF_STEP.ID = CC.PK_ID AND CC.TABLE_NAME='BPM_DEF_STEPS' AND CC.LANGUAGE_CODE='en'



    JOIN BPM_DEF_STEP_ACTIONS STEP_NAME ON DEF_STEP.ID = STEP_NAME.STEP_ID JOIN CMN_CAPTIONS_NLS DD



    ON STEP_NAME.ID = DD.PK_ID AND DD.LANGUAGE_CODE='en' AND DD.NAME='${PROCESS_STEP_NAME}' AND DD.TABLE_NAME='BPM_DEF_STEP_ACTIONS'



    JOIN BPM_RUN_PROCESSES INSTANCES ON STEP.PROCESS_INSTANCE_ID = INSTANCES.ID JOIN BPM_RUN_OBJECTS RUNOBJECTS ON



    RUNOBJECTS.PK_ID = INSTANCES.ID AND RUNOBJECTS.TABLE_NAME = 'BPM_RUN_PROCESSES' AND RUNOBJECTS.OBJECT_TYPE_CODE = 'requisition'



    JOIN RSM_REQ_REQUISITIONS REQ ON RUNOBJECTS.OBJECT_ID = REQ.ID AND REQUISITION_CODE='${REQUISITION_CODE}'



    JOIN BPM_RUN_STEP_ACTION_RESULTS RES ON RES.STEP_INSTANCE_ID = STEP.ID JOIN BPM_RUN_ASSIGNEES ASSIGNEES



    ON ASSIGNEES.PK_ID=RES.ID AND ASSIGNEES.TABLE_NAME = 'BPM_RUN_STEP_ACTION_RESULTS' AND AI_STATUS_CODE in ('CAL_OPEN'))









    </sql:update>
    <sql:update>


    UPDATE CAL_ACTION_ITEM_ASSIGNEES SET ASSIGNEE_ID=(SELECT ID FROM CMN_SEC_USERS WHERE USER_NAME ='${REASSIGNEE_USER_NAME}') WHERE ID = (



    SELECT ASSIGNEES.ID FROM BPM_RUN_STEPS STEP JOIN BPM_DEF_STEPS DEF_STEP ON STEP.STEP_ID = DEF_STEP.ID JOIN CMN_CAPTIONS_NLS CC



    ON DEF_STEP.ID = CC.PK_ID AND CC.TABLE_NAME='BPM_DEF_STEPS' AND CC.LANGUAGE_CODE='en' JOIN BPM_DEF_STEP_ACTIONS STEP_NAME ON



    DEF_STEP.ID = STEP_NAME.STEP_ID JOIN CMN_CAPTIONS_NLS DD ON STEP_NAME.ID = DD.PK_ID AND DD.LANGUAGE_CODE='en' AND DD.NAME='${PROCESS_STEP_NAME}'



    AND DD.TABLE_NAME='BPM_DEF_STEP_ACTIONS' JOIN BPM_RUN_PROCESSES INSTANCES ON STEP.PROCESS_INSTANCE_ID = INSTANCES.ID



    JOIN BPM_RUN_OBJECTS RUNOBJECTS ON RUNOBJECTS.PK_ID = INSTANCES.ID AND RUNOBJECTS.TABLE_NAME = 'BPM_RUN_PROCESSES'



    AND RUNOBJECTS.OBJECT_TYPE_CODE = 'requisition' JOIN RSM_REQ_REQUISITIONS REQ ON RUNOBJECTS.OBJECT_ID = REQ.ID AND REQUISITION_CODE='${REQUISITION_CODE}' JOIN BPM_RUN_STEP_ACTION_RESULTS RES ON RES.STEP_INSTANCE_ID = STEP.ID JOIN CAL_ACTION_ITEMS AITEMS ON STEP.PROCESS_INSTANCE_ID=AITEMS.OBJECT_ID JOIN CAL_ACTION_ITEM_ASSIGNEES ASSIGNEES ON ASSIGNEES.CAL_ACTION_ITEM_ID = AITEMS.ID)


    </sql:update>
    </core:forEach>
    </gel:script>
    </scriptText>
    <scriptParameter isSecure="false"
    name="debug" value="1"/>
    </customScript>
    <Notifications notifyOwner="false">
    <NotifyWhen stepActionInError="false"
    stepActionPerformed="false" value="0"/>
    <Assignees/>
    </Notifications>
    </Action>
    </Operations>
    <TransitionRestrictions>
    <TransitionRestriction>
    <Join type="BPM_JT_NONE">
    <Condition sequencNo="1" type="BPM_SCT_PRECONDITION"/>
    </Join>
    </TransitionRestriction>
    <TransitionRestriction>
    <Split type="BPM_ST_SEQUENCE">
    <Condition sequencNo="1" type="BPM_SCT_POSTCONDITION">
    <Transitions>
    <Transition to="Finish"/>
    </Transitions>
    </Condition>
    </Split>
    </TransitionRestriction>
    </TransitionRestrictions>
    </Step>
    <Step id="Finish" isMileStone="false" sequenceNo="2">
    <nls languageCode="cs" name="Finish"/>
    <nls languageCode="da" name="Finish"/>
    <nls languageCode="de" name="Finish"/>
    <nls languageCode="en" name="Finish"/>
    <nls languageCode="es" name="Finish"/>
    <nls languageCode="fi" name="Finish"/>
    <nls languageCode="fr" name="Finish"/>
    <nls languageCode="it" name="Finish"/>
    <nls languageCode="ja" name="Finish"/>
    <nls languageCode="ko" name="Finish"/>
    <nls languageCode="nl" name="Finish"/>
    <nls languageCode="no" name="Finish"/>
    <nls languageCode="pt" name="Finish"/>
    <nls languageCode="sv" name="Finish"/>
    <nls languageCode="zh" name="Finish"/>
    <nls languageCode="zh_TW" name="Finish"/>
    <Notifications notifyOwner="false">
    <NotifyWhen stepCompleted="false"
    stepInError="false" stepStarted="false"/>
    <Assignees/>
    </Notifications>
    <Operations/>
    <TransitionRestrictions>
    <TransitionRestriction>
    <Join type="BPM_JT_NONE">
    <Condition sequencNo="1" type="BPM_SCT_PRECONDITION"/>
    </Join>
    </TransitionRestriction>
    <TransitionRestriction>
    <Split type="BPM_ST_SEQUENCE">
    <Condition sequencNo="1" type="BPM_SCT_POSTCONDITION">
    <Transitions/>
    </Condition>
    </Split>
    </TransitionRestriction>
    </TransitionRestrictions>
    </Step>
    </Steps>
    <Groups/>
    <OBSAssocs completed="false"/>
    </Process>
    </Processes>
    <XOGOutput>
    <Object type="bpm_process"/>
    <Status state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0"
    totalNumberOfRecords="1" updatedRecords="0"/>
    <Records/>
    </XOGOutput>
    </NikuDataBus>



    4. Goto Jobs execute Process.
    5. Once Process exection is completed, then validate.


    Let me know, if any help is required.

    Thanks
    Senthil



    3. To Create a process


  • 10.  RE: Reassign Action Items using Gel Script

    Posted Jun 08, 2012 09:26 AM
    Hi.

    please i don't think i understand... it is possible forward action item to another resource in Clarity by some button, field which will eb created?

    EDIT: any news? :)) thanks

    thank you
    BR
    Michal.


  • 11.  Moving to correct board.

     
    Posted Oct 26, 2010 02:07 PM
    Moving to correct board.