BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  createDiscretionaryActivityWithProps function

    Posted 04/03/25 09:06 AM

    Greetings,

    We have an activity created with "Activity with a New Process" in BAW Case Solution of IBM BAW 24.0.1.

    I am trying to pass the value of an input variable after creating the Discretionary Activity using the below function

    var inputPropertyNames = new tw.object.listOf.String();
    var inputPropertyValues = new tw.object.listOf.String();
    inputPropertyNames[0] = 'test';
    inputPropertyValues[0] = "value";

    tw.system.currentProcessInstance.parentCase.createDiscretionaryActivityWithProps("ACTIVITY_NAME", null,null,inputPropertyNames , inputPropertyValues, true);

    test is defined as an Input Variable after opening the Activity in the Designer

    Activity is getting started but the value of the variable "test" is undefined

    Can someone suggest what is needed to make this work ? 

    Thanks



    ------------------------------
    Lakshya Agarwal
    ------------------------------


  • 2.  RE: createDiscretionaryActivityWithProps function

    Posted 04/04/25 01:17 AM

    Hello!

    The properties on case activities are defined in the data model for the case solution and what is expected here is the symbolic name (aka prop ID) of the prop you want.

    For example, if your solution is called "Hello World", the default solution ID would be HW and a prop you define with a pretty name "test" would have symbolic name of HW_test.



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



  • 3.  RE: createDiscretionaryActivityWithProps function

    Posted 04/04/25 01:20 AM

    You can see the symbolic name when you look at the property you added to the case activity.



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



  • 4.  RE: createDiscretionaryActivityWithProps function

    Posted 04/04/25 11:44 AM

    Hello,

    I had a similar issue on my side, in our case we wanted to provide some document IDs as an input.

    What we have done was:

    1. Launch the activity, 
    2. Use the generated process ID to mark the documents (i.e, stored as a document property).
    3. Inside the Process we were able to retrieve those documents using this property.

    I see a a similar approach with case properties.

    Another try would be to check if the case REST API has some methods that may help you.

    Open case APIs - IBM Documentation

    This API documentation is "recent". I used it on version 21 (with no YAML definition) to update case properties from code outside of the case.

    Hope it helps.

    Regards,



    ------------------------------
    Adriano Andrade
    ------------------------------