1 Reply Latest reply on Jan 9, 2013 6:47 PM by 674705

    Automatic Global runtask with args fail in enterprise but works in studio

    674705
      I'm using a runtask function to execute a method on an instance. everything is working fine except in enterprise, it just keep crashing.
      here is the code and error message. somebody can help me or another way to update a variable from automatic global activity?

      CODE :

      ProcessService ps;
      Fuego.Xml.XMLObject xmlObject;
      try {
      logMessage("The start");

      ps.connectTo(url : Fuego.Server.directoryURL, user : "RMUser", password : "rmuser");

      InstanceFilter instF;
      instF.create(processService : ps);

      instF.addAttributeTo(variable : "PREDEFINE_ACTIVITY", comparator : IS, value : "GICAccepter");

      instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL,
      statusScope : StatusScope.ONLY_INPROCESS);

      foreach (inst in ps.getInstancesByFilter(filter : instF)) {
      Object panel = inst.getVar(var : "panel");
      xmlObject = XMLObject(xmlText : DynamicXml.createXmlTextFor(object : panel,
      topLevelTag : "xsi"));

      logMessage("GIC The value of the courrielRappelEnvoye is " +
      xmlObject.selectString(xpath : "courrielRappelEnvoye"));

      if (xmlObject.selectString(xpath : "courrielRappelEnvoye") != "true") {
      try {
      if (inst.participantId != null) {
      Participant participant2 = Participant.find(name : inst.participantId);

      logMessage("GIC The participant assigned to this instance is: " + participant2.email);

      if (xmlObject.selectString(xpath : "courrielRappel") == participant2.email) {
      logMessage("GIC Envoi courriel a : " + participant2.email);

      InformationActiviteRequest informationActiviteReq;
      informationActiviteReq.noAllegro = "0";
      informationActiviteReq.typeActivite = "GIC_ACCEPTER";
      informationActiviteReq.nomParticipant = participant2.email;
      informationActiviteReq.typeContact = "PARTICIPANT";
      informationActiviteReq.url = ((String) BusinessParameter.getValue(organizationalUnit : "ALGR",
      name : "ALGR_SERVEURWORKSPACE"));
      InformationActiviteService.sendNotification(parInformationActiviteRequest : informationActiviteReq, out parInformationActiviteResponse : parInformationActiviteResponse);

      logMessage("GIC The resultat de l'envoi email: " + parInformationActiviteResponse.erreurMessage);

      suspendu = inst.suspended;

      if (suspendu) {
      inst.resume();
      }

      inst.reasign(participant : "RMUser");

      inst.runTask(activity : "updateCourrielEnvoyeRappelGIC");

      inst.reasign(participant : participant2.id);

      if (suspendu) {
      inst.suspend();
      }
      }
      else {
      logMessage("GIC update courriel pour : " + participant2.email);

      if (suspendu) {
      inst.resume();
      }

      inst.reasign(participant : "RMUser");

      ar["courriel"] = participant2.email;

      inst.runTask(activity : "updateCourrielRappel", args : ar);
      inst.reasign(participant : participant2.id);


      if (suspendu) {
      inst.suspend();
      }
      }
      }
      }
      catch (Exception e) {
      logMessage("erreur + " + e);

      logMessage("erreur + " + e.cause);

      logMessage("erreur + " + e.stackTrace);
      }
      }



      ERROR MESSAGE

      A component failed while executing activity '/ALGR/ALGR_ExecuterDemandeClient#Default-1.0/EnvoiCourrielRappel' (BP-method EnvoiCourrielRappel).
      Details:
      The task could not be successfully executed.
      Reason: 'java.lang.NullPointerException'.
      Caused by: java.lang.NullPointerException
      fuego.lang.ComponentExecutionException: The task could not be successfully executed.
      Reason: 'java.lang.NullPointerException'.
           at fuego.server.execution.EngineExecutionContext.invokeMethodAsCil(EngineExecutionContext.java:1100)
           at fuego.server.execution.EngineExecutionContext.runCil(EngineExecutionContext.java:1295)
           at fuego.server.execution.TaskExecution.invoke(TaskExecution.java:401)
           at fuego.server.execution.GlobalTaskExecution.invoke(GlobalTaskExecution.java:146)
           at fuego.server.execution.TaskExecution.executeCIL(TaskExecution.java:513)
           at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:698)
           at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:658)
           at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:154)
           at fuego.server.execution.GlobalTaskExecution.executeGlobalCIL(GlobalTaskExecution.java:116)
           at fuego.server.execution.GlobalTaskExecution.executeGlobalCIL(GlobalTaskExecution.java:96)
           at fuego.server.execution.GlobalTaskExecution.executeGlobalCIL(GlobalTaskExecution.java:87)
           at fuego.server.execution.GlobalAutomaticScheduled.execute(GlobalAutomaticScheduled.java:56)
           at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
           at fuego.transaction.TransactionAction.startNestedTransaction(TransactionAction.java:527)
           at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:548)
           at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
           at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
           at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:62)
           at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42)
           at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:267)
           at fuego.ejbengine.ItemExecutionBean$1.execute(ItemExecutionBean.java:235)
           at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
           at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470)
           at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:551)
           at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
           at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
           at fuego.server.execution.EngineExecution.executeImmediate(EngineExecution.java:66)
           at fuego.ejbengine.ItemExecutionBean.processMessage(ItemExecutionBean.java:221)
           at fuego.ejbengine.ItemExecutionBean.onMessage(ItemExecutionBean.java:120)
           at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
           at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
           at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
           at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
           at weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
           at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
           at weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
           at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)
           at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      Caused by: java.lang.NullPointerException
           at fuegoblock.papi.Instance.runTask(Instance.java:1040)
           at fuegoblock.papi.Instance.runTask(Instance.java:944)
           at fuegoblock.papi.Instance.runTask(Instance.java:865)
           at fuegoblock.papi.Instance.runTask(Instance.java:807)
           at oracle.ALGR_ExecuterDemandeClient.Default_1_0.Instance.CIL_envoiCourrielRappel(Instance.xcdl:149)
           at oracle.ALGR_ExecuterDemandeClient.Default_1_0.Instance.CIL_envoiCourrielRappel(Instance.xcdl)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at fuego.server.execution.EngineExecutionContext.invokeMethodAsCil(EngineExecutionContext.java:1091)
           ... 39 more

      Edited by: Jérémie Ouellet on Jan 9, 2013 11:15 AM