BPM, Workflow, and Case

BPM, Workflow, and Case

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

 View Only

Problem with Opening BAW process instance created programmatically

  • 1.  Problem with Opening BAW process instance created programmatically

    Posted 10/14/24 10:08 AM

    Greetings,

    We have a BAW Activity defined with a New Process. This Process has a launch UI configured which opens the UI (coach automatically) when the task is created.

    Task is created with the below code on the click of a button

    execute: function(ctx)
            {

     ctx.getActionContext("Case")[0].createNewTaskEditable(taskType, dojo.hitch(this,function(taskEditable){
                                         
                                            taskEditable.getProperty("F_CaseTask","TEST").setValue("TEST");

     taskEditable.setTaskName("TASK NAME"); 

      var addTaskPagePayload = {      
                                         "taskEditable": taskEditable,        
                                         "coordination": new icm.util.Coordination()     
                                         };    
                                        
                                             ctx.onBroadcastEvent("icm.AddTask", addTaskPagePayload);

    }));

    }
                                        

    After the broadcast event it opens the task automatically. I have noticed that after the CPE and BAW restart, when user tries to create the first task it fails to open because it misses the below object

    taskEditable > icmTask > bpmWorkItem

    So basically it doesn't have BPM Process Instance.

    Afterwards it works normally so its always a problem with the first task creation

    Can someone suggest how to fix it ?

    Thanks



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