Sub-process input variable: Cannot index from an array using tp[instanceIndex]

Hi everyone, I'm having this issue where I'm trying to index a date and time array using the index of caseID from another array with same order. Below are the process variables and the code that I wrote:

allCases Number (Integer) 3,061,158; 3,061,157; 3,061,156; 3,061,155; 30,611,111; 306,115,555

updatedDateTime Date and Time 20 May 2023 12:00; 21 May 2023 12:00; 20 Jun 2023 12:00; 6 Dec 2023 12:00; 20 May 2023 12:00; 20 May 2023 12:00

However there was no updatedDateTime value passed into my sub-process, so I'm wondering what did I do wrong with the indexing.

Any idea? Thanks a lot in advance :)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi 

    Please try this to solve your MNI

    I am setting some value in caseid, casewithtask and date in first script task

    In Second script task i mapped the case id and date into a CDT

    In Sub Process I am using the mapped CDT for MNI

    Here is the data from sub process instance

  • 0
    Certified Lead Developer
    in reply to Komal Jain

    FYI, this is the sort of solution I proposed above, except now with the ability to add PVs of the type "Map", there's no need to create a custom CDT just to hold the values in question as you seem to have done here with pv!allData and the "KJA_caseswithtask" data type.  We can just create a Map (multiple) PV and assemble an array of Map objects within the a!forEach loop, and the process handles it.

    Edit: but i'm giving you a well-earned upvote anyway due to your apparently extensive work setting up a live example, and gathering of screenshots - well done Slight smile

Reply
  • 0
    Certified Lead Developer
    in reply to Komal Jain

    FYI, this is the sort of solution I proposed above, except now with the ability to add PVs of the type "Map", there's no need to create a custom CDT just to hold the values in question as you seem to have done here with pv!allData and the "KJA_caseswithtask" data type.  We can just create a Map (multiple) PV and assemble an array of Map objects within the a!forEach loop, and the process handles it.

    Edit: but i'm giving you a well-earned upvote anyway due to your apparently extensive work setting up a live example, and gathering of screenshots - well done Slight smile

Children