[ https://issues.apache.org/jira/browse/ODE-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12748912#action_12748912 ]
Enrico Levesque edited comment on ODE-483 at 8/28/09 12:22 PM: --------------------------------------------------------------- Hi all, I was able to run the Replayer on my own processes but with some modifications. I still get an error though when it needs to retrieve an instance by correlation. I added this fix to BpelRuntimeContextImpl.getCurrentEventDateTime() : was - public Date getCurrentEventDateTime() { return _currentEventDateTime; } changed to - public Date getCurrentEventDateTime() { if (_currentEventDateTime == null) return Calendar.getInstance().getTime(); else return _currentEventDateTime; } This other fix to invoke(...) in the same class : was - ... MessageExchangeDAO mexDao = _dao.getConnection().createMessageExchange( MessageExchangeDAO.DIR_BPEL_INVOKES_PARTNERROLE); mexDao.setStatus(MessageExchange.Status.NEW.toString()); mexDao.setOperation(operation.getName()); ... changed to - MessageExchangeDAO mexDao = _dao.getConnection().createMessageExchange( MessageExchangeDAO.DIR_BPEL_INVOKES_PARTNERROLE); /* modif enrico */ mexDao.setCreateTime(getCurrentEventDateTime()); mexDao.setStatus(MessageExchange.Status.NEW.toString()); mexDao.setOperation(operation.getName()); This fix to PartnerLinkMyRoleImpl.invoke(...) : was - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.CREATE_INSTANCE); mex.getDAO().setInstance(newInstance); instance.execute(); changed to - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.CREATE_INSTANCE); mex.getDAO().setInstance(newInstance); /* modif enrico * createTime needs to be initialized for getCommunication in Replayer*/ if (mex.getDAO().getCreateTime() == null) mex.getDAO().setCreateTime(instance.getCurrentEventDateTime()); instance.execute(); And into invokeInstance(...) of the same class : was - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.MATCHED); mex.getDAO().setInstance(routing.messageRoute.getTargetInstance()); instance.execute(); changed to - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.MATCHED); mex.getDAO().setInstance(routing.messageRoute.getTargetInstance()); /* modif enrico * if createTime need to be initialized */ if (mex.getDAO().getCreateTime() == null) mex.getDAO().setCreateTime(instance.getCurrentEventDateTime()); instance.execute(); I also did two other fix but I never verified if they where necessary. ASSIGN public Date getCurrentEventDateTime() { /* enrico modif */ //return null; return Calendar.getInstance().getTime(); } PropertyAliasEvaluationContext public Date getCurrentEventDateTime() { /* enrico modif */ return Calendar.getInstance().getTime(); //return null; } These where necessary so we can use getCommunication on instances created without the Replayer. was (Author: enricolds): Hi all, I was able to run the Replayer on my own processes but with some modifications as explained earlier, but the processes need to be RUNNING IN MEMORY. I added this fix to BpelRuntimeContextImpl.getCurrentEventDateTime() : was - public Date getCurrentEventDateTime() { return _currentEventDateTime; } changed to - public Date getCurrentEventDateTime() { if (_currentEventDateTime == null) return Calendar.getInstance().getTime(); else return _currentEventDateTime; } This other fix to invoke(...) in the same class : was - ... MessageExchangeDAO mexDao = _dao.getConnection().createMessageExchange( MessageExchangeDAO.DIR_BPEL_INVOKES_PARTNERROLE); mexDao.setStatus(MessageExchange.Status.NEW.toString()); mexDao.setOperation(operation.getName()); ... changed to - MessageExchangeDAO mexDao = _dao.getConnection().createMessageExchange( MessageExchangeDAO.DIR_BPEL_INVOKES_PARTNERROLE); /* modif enrico */ mexDao.setCreateTime(getCurrentEventDateTime()); mexDao.setStatus(MessageExchange.Status.NEW.toString()); mexDao.setOperation(operation.getName()); This fix to PartnerLinkMyRoleImpl.invoke(...) : was - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.CREATE_INSTANCE); mex.getDAO().setInstance(newInstance); instance.execute(); changed to - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.CREATE_INSTANCE); mex.getDAO().setInstance(newInstance); /* modif enrico * createTime needs to be initialized for getCommunication in Replayer*/ if (mex.getDAO().getCreateTime() == null) mex.getDAO().setCreateTime(instance.getCurrentEventDateTime()); instance.execute(); And into invokeInstance(...) of the same class : was - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.MATCHED); mex.getDAO().setInstance(routing.messageRoute.getTargetInstance()); instance.execute(); changed to - mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.MATCHED); mex.getDAO().setInstance(routing.messageRoute.getTargetInstance()); /* modif enrico * if createTime need to be initialized */ if (mex.getDAO().getCreateTime() == null) mex.getDAO().setCreateTime(instance.getCurrentEventDateTime()); instance.execute(); I also did two other fix but I never verified if they where necessary. ASSIGN public Date getCurrentEventDateTime() { /* enrico modif */ //return null; return Calendar.getInstance().getTime(); } PropertyAliasEvaluationContext public Date getCurrentEventDateTime() { /* enrico modif */ return Calendar.getInstance().getTime(); //return null; } These where necessary so we can use getCommunication on instances created without the Replayer. replayInstances works again but only when processes are executed in memory. > Instance replayer > ----------------- > > Key: ODE-483 > URL: https://issues.apache.org/jira/browse/ODE-483 > Project: ODE > Issue Type: New Feature > Affects Versions: Wishlist > Reporter: Rafal Rusin > Fix For: Wishlist > > Attachments: Khriss-AdaptabilitySupport.pdf, replayer-example.zip, > replayer-proposal.diff > > > Imagine situation when client has deployed a process with a lot of active, > long running instances. Then he finds there's a bug in this process and a > simple bugfix is needed. But with current versioning rules, new version is > only used when new instances are created. So there's no simple way for doing > such bufixes (which are usually possible with eg. java application using > database connection). It is a blocking argument for deploying ODE Bpel > solution instead of a regular java application. > I think the best way to deal with such situations is to add > serialize/deserialize to/from xml operations for process instances in > management API. Also pause/resume ODE operations would be useful. > Then, a bugfix procedure would look like this; > -pause ode > -serialize instances > -deploy newer version > -deserialize instances and fix manually any import errors > -resume ODE > It would also be a benefit of being able to do migration from older to newer > ODE and between Hibernate/JPA DAOs, which I saw already in some bug reports. > What do you think about it? > Regards -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.