IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Java Service fails when invoked from taskj rule

  • 1.  Java Service fails when invoked from taskj rule

    Posted 01/18/11 03:52 PM

    I have a java Service that throws the following error when called from a business task rule:

    2011-01-16 12:16:39 CST [PRT.0101.0376E] Error invoking step POSTTDE_S13, PID=1fa4de5f-7c4b-41a2-b1f5-90f56fca6024:1 (TramitesPension.AltaPago.AltaPago_1.Default:AP_Confirmar_Pago_OutputMapService): [PRT.0101.9432] Task execution was unsuccessful. The task engine returned status: error and error message: Unhandled Exception during rule processing. Rule [/meta/default/wm_xt_portalrules/0000009917] com.webMethods.caf.rules.RuleException: com.webMethods.caf.common.CommonException: Unable to convert data type “java.lang.Object” to “java.util.Date”
    at com.webMethods.caf.rules.impl.comparator.AssignmentComparator.evaluateBoolean(AssignmentComparator.java:76)
    at com.webMethods.caf.rules.impl.logicalOp.BaseLogicalOp.evaluate(BaseLogicalOp.java:28)
    at com.webMethods.caf.rules.impl.logicalOp.SemiColonLogicalOp.evaluate(SemiColonLogicalOp.java:44)
    at com.webMethods.caf.rules.impl.logicalOp.SemiColonLogicalOp.evaluate(SemiColonLogicalOp.java:44)
    at com.webMethods.caf.rules.impl.logicalOp.SemiColonLogicalOp.evaluate(SemiColonLogicalOp.java:44)
    at com.webMethods.caf.rules.impl.Rule.evaluateResult(Rule.java:65)
    at com.webMethods.portal.mech.task.impl.TaskRuleHelper.evaluateRule(TaskRuleHelper.java:111)
    at com.webMethods.portal.mech.task.impl.TaskChangeHandler.evaluateTriggerRule(TaskChangeHandler.java:689)
    at com.webMethods.portal.mech.task.impl.TaskChangeHandler.processTriggerRulesInFolder(TaskChangeHandler.java:701)
    at com.webMethods.portal.mech.task.impl.TaskChangeHandler.processTaskChangedEvent(TaskChangeHandler.java:591)
    at com.webMethods.portal.mech.task.impl.TaskChangeHandler$2.run(TaskChangeHandler.java:308)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: com.webMethods.caf.common.CommonException: Unable to convert data type “java.lang.Object” to “java.util.Date”
    at com.webMethods.caf.common.ObjectUtil.convertToType(ObjectUtil.java:381)
    at com.webMethods.caf.common.ObjectUtil.convertToType(ObjectUtil.java:58)
    at com.webMethods.caf.rules.impl.comparator.AssignmentComparator.evaluateBoolean(AssignmentComparator.java:70)
    … 16 more

    The java service receives 1 object and 1 string and returns one object. When run in developer it runs ok. This is the code

    IDataCursor idcPipeline = pipeline.getCursor();
    try {
    Date fecha = new Date();
    String nroDias;
    int nroDiasInt;

    if (idcPipeline.first(“nroDias”)) {
    nroDias = (String) idcPipeline.getValue();
    }else {
    throw new ServiceException(“Bad Parameter.”);
    }

    Date fechaIncDias;
    Calendar fechaCal = Calendar.getInstance();

    int dias = fechaCal.get(Calendar.DAY_OF_MONTH);
    nroDiasInt = Integer.parseInt(nroDias);
    dias = dias + nroDiasInt;
    fechaCal.set(Calendar.DAY_OF_MONTH, dias);
    fechaCal.set(Calendar.HOUR_OF_DAY, 0);
    fechaCal.set(Calendar.MINUTE, 0);
    fechaCal.set(Calendar.SECOND, 0);

    fechaIncDias = fechaCal.getTime();

    idcPipeline.insertAfter(“fechaResult”, fechaIncDias);
    }catch (Exception e) {
    throw new ServiceException(e.getMessage());
    }

    idcPipeline.destroy();

    What could be happening?

    Thx,


    #webMethods-BPMS
    #webMethods
    #BPM


  • 2.  RE: Java Service fails when invoked from taskj rule

    Posted 01/24/11 10:30 PM

    Guys, it’s solved. Basically I set the Java wrapper type of the output to java.util.Date in Developer.


    #webMethods-BPMS
    #BPM
    #webMethods