BPM, Workflow, and Case

 View Only
  • 1.  Start discretionary task with properties

    Posted Tue March 05, 2024 11:36 AM

    Hi,

    there's a way to start a discretionary task through Case REST API (see URI /CASEREST/v1/case/{case folder id}/tasks).

    How to start this task initializing some task's properties ? Or how to update the properties after the task creation ?

    Thanks for help

    Yannick



    ------------------------------
    Yannick Martin
    ------------------------------


  • 2.  RE: Start discretionary task with properties

    Posted Wed March 06, 2024 10:50 AM

    Does this help?

    https://www.ibm.com/docs/en/baw/23.x?topic=cnar-post-method

    Please note that originally case ACTIVITIES we called Case TASKS back in the pre-ICM 52x days. We renamed these in the UI to better represent what they are and to not conflict with the TASK term used to describe a user task that shows up in their in basket. 

    Since we try to not break existing APIs, the task/activity term still shows there.

    Also not that Case Activity instances are just FileNet contentless objects with properties on them. You can also <carefully> use CPE APIs to access them using the instance GUID you get from the create/find case activity APIs.



    ------------------------------
    DAVE PERMAN
    ------------------------------



  • 3.  RE: Start discretionary task with properties

    IBM Champion
    Posted Fri March 29, 2024 09:35 AM

    Yannick,

    The way we have it working is by means of JavaScript in BAW. I hope this an alternative.

    In BAW 23.01 the System createDiscretionaryActivityWithProps method is added. (see https://www.ibm.com/docs/en/baw/23.x?topic=apis-javascript-api-in-processes-cases-service-flows)

    With this method you can start a discretionaryActivity with the Activity Properties argument list you defined in the Activity.
    The advantage of this method is that you can call it for all cases outside scope by using the caseId. Normally you can also use tw.system.currentProcessInstance.parentCase methods.


    createDiscretionaryActivityWithProps(String caseId , String objectStoreName , String discretionaryActivityName , String[] activityPropertyNames , String[] activityPropertyValues , Boolean asAdministrator , String newActivityName);


    An example

    tw.local.caseId = "xyz";  // The ID of the case Instance found by a previous query
    var activityPropertyNames  = new tw.object.listOf.String(); // The list of property argument names 
    var activityPropertyValues = new tw.object.listOf.String(); // The list of property argument values 

    activityPropertyNames[0] = "HSC_Argument1";
    activityPropertyValues[0] = "SomeValue"; // Single String value

    tw.local.activityId = tw.system.createDiscretionaryActivityWithProps(tw.local.caseId, tw.env.TargetObjectStore, "HSC_MyActivity", activityPropertyNames, activityPropertyValues, false, "My Activity");

    Please note that Activity Properties are only available for a discretionary "Activity with New Process" and not supported for a discretionary "Activity with Existing Process".
    When you use "Activity with Existing Process" there is an option to pass the Internal Case properties to an external process. 
    IBM told us that this is by design and will be possibly changed in the future.



    ------------------------------
    Henry Schenau
    BAW Integration Specialist
    Nationale-Nederlanden
    ------------------------------



  • 4.  RE: Start discretionary task with properties

    Posted Mon April 01, 2024 04:43 AM

    Hi Henry, 

    thank you for these informations.

    In our case we want to start an existing activity which is already attached to an existing process.

    BR

    Yannick 



    ------------------------------
    Yannick Martin
    ------------------------------