2 Replies Latest reply on May 9, 2014 2:20 AM by Maciej Swiderski

    Process Instance Is Disconnected While Persistence Configured

    Jan Stastny Newbie

      Hello,

      I came across a problem when configured persistence with jbpm.

      I have a process with object variable. Problem is, that the variable changes during the run of process. And I'd like to promote the change to the process. Without persistence this works as the object in working memory and in project are the same, I suppose. But when persistence set, the change of fact in workingmemory isn't promoted into the process instance.

      I tried to achieve this scenario by defining a drools rule for the process, fired on the object change.

      rule "City Update In Process"

        lock-on-active true

        when

        $city:CityDTO(

        $id:id

        )@watch(*)

        $process:WorkflowProcessInstance(

        processId=="cz.muni.fi.civ.newohybat.bpmn.buildCityImprovement"

        ,((CityDTO)getVariable("city")).getId()==$id

        ,$processId:id

        )

        ProcessWaitsForTurnEvent(

        processId==$processId

        )

        then

        modify($process){

        setVariable("city",$city);

        }

      end

      But when the rule is fired as needed, exception occurs. It says that modified $process is disconnected.

       

      My question is: can I connect it somehow, or should I change my approach? If so, any suggestions?