Clarity

  • 1.  How to queue multiple processes start in the same time?

    Posted Mar 28, 2019 05:28 AM

    Dear all,

     

    We have implemented functionality: project create by process . The process is invoked by SOAP from another application.

    In this process we have these steps:

    1, evaluate input values

    3, get next project code from DB (this is really weird that for project create XOG we have to increase sequence manually, but I don't know other way)

    2, create project by XOG (with mandatory project code from upper calculation)

    3, run another initial processes for some updates on this new project (this is shared process, valid also for projects created manually in Clarity))

    When I call by SOAP one process the project is created correctly, but when I call 5 processes in one SOAP, all processes are created in the same time in clarity, but only 2 projects are created with incorrect initial setup.

    One if the issue is that there was calculated the same project code in parallel running processes - this I'm going to handle by table lock in DB.

    Anyway the best would be to queue somehow these processes so make processes wait until another finish.

     

    Thanks and regard,

    Marian.



  • 2.  Re: How to queue multiple processes start in the same time?

    Posted Mar 28, 2019 05:37 AM

    Actually the DB lock table will not help because problem is that the processes read and use in project create XOG same project code.

    So the process must wait until other finish.



  • 3.  Re: How to queue multiple processes start in the same time?

    Posted Mar 28, 2019 09:12 PM

    Can you provide more details on how this is being undertaken:

    3, get next project code from DB

    For example, are using Oracle NEXTVAL, or are you using a custom attribute somewhere which is being updated?

     

    Otherwise, GEL does include a 'SLEEP' utility:

    <util:sleep millis="1000"/>

    There are mixed community views if this should be used in PPM, but I have used it at one PPM site.

     

    As a suggestion, why can't the external application which is invoking the SOAP call pass the Project ID as part of the SOAP call. Potentially it will have some form of Project Code in the external application, so it could use that Project Code in PPM.  Just a thought.



  • 4.  Re: How to queue multiple processes start in the same time?
    Best Answer

    Posted May 24, 2019 04:20 AM

    Hello Roland,

     

    thanks for reply and I'm sorry for late response.

     

    3, get next project code from DB: by custom function which return next ID(l_project_code) using procedure  CMN_AUTONUM_GET_NEXT_SP ('project', 'unique_code', 'NIKU.ROOT', 'inv_investments', 'code', null, 0, l_project_code);  Here I really don’t understand how it’s possible that function return more times the same ID!

     

    'SLEEP' utility: I thought about this option, but I saw "mixed community views"  and also there is required response time when external app receive confirmation that project has been created (including URL of new project instance)  so I don't want delay standard project create flow.

     

    Regarding pass ID from external app as part of the SOAP call which is good idea, but in our case it would require redesign of existing solution. We have multiple types of the same object instance, which can be created from Clarity UI or by external app.

    To identify particular project instance we use "ProjectID" which is project type||project code. E.g.  A0001, A0002, B0003, C0004, A0005 .... where “A” is created by external tool “B” and “C” are created from UI.  So project code(0001,0002 ....) follow the same sequence for all types.

     

     

     I've run a SoapUI test case with multiple SOAP call with 1sec delay and all project has been created correctly so we've agreed with client that there is really low risk that the project create call from external app will come in the same time (in one sec) we decided to ignore this case.

     

    Best regards,

    Marian.



  • 5.  Re: How to queue multiple processes start in the same time?

    Posted Mar 28, 2019 04:17 PM

    I would think that if you persisted the project code into global scope at the start of the process and cleared at the end of the process, you could use that global variable to determine if another process is currently running.

     

    Look at gel:persist tag with scope="GLOBAL".

     

    You will need to figure out a slow / wait loop for the process to check the global scope before continuing.

     

    V/r,

    Gene