Search in sources :

Example 1 with InstanceInfoWithEventsType

use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoWithEventsType in project carbon-business-process by wso2.

the class InstanceManagementServiceSkeleton method fillFaultAndFailure.

/**
 * Use fillFaultAndFailure(ProcessInstanceDAO, InstanceInfoType) to fill the
 * instanceInfoWithEvents
 *
 * @param instance               Process Instance DAO
 * @param instanceInfoWithEvents Instance info with events
 */
private void fillFaultAndFailure(ProcessInstanceDAO instance, InstanceInfoWithEventsType instanceInfoWithEvents) {
    InstanceInfoType instanceInfo = new InstanceInfoType();
    fillFaultAndFailure(instance, instanceInfo);
    if (instance.getFault() != null) {
        instanceInfoWithEvents.setFaultInfo(instanceInfo.getFaultInfo());
    }
    if (instance.getActivityFailureCount() > 0) {
        instanceInfoWithEvents.setFailuresInfo(instanceInfo.getFailuresInfo());
    }
}
Also used : InstanceInfoType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoType) LimitedInstanceInfoType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.LimitedInstanceInfoType)

Example 2 with InstanceInfoWithEventsType

use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoWithEventsType in project carbon-business-process by wso2.

the class InstanceManagementServiceSkeleton method getInstanceInformationWithEvents.

private InstanceInfoWithEventsType getInstanceInformationWithEvents(final long iid) throws InstanceManagementException {
    final InstanceInfoWithEventsType instanceInfoWithEvents = new InstanceInfoWithEventsType();
    instanceInfoWithEvents.setIid(Long.toString(iid));
    dbexec(new BpelDatabase.Callable<Object>() {

        public Object run(BpelDAOConnection conn) throws InstanceManagementException {
            ProcessInstanceDAO instance = conn.getInstanceEagerly(iid, true);
            if (instance == null) {
                String errMsg = "Instance " + iid + " not found.";
                log.error(errMsg);
                throw new InstanceManagementException(errMsg);
            }
            fillInstanceInfoWithEvents(instanceInfoWithEvents, instance);
            return null;
        }
    });
    return instanceInfoWithEvents;
}
Also used : InstanceManagementException(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.InstanceManagementException) ProcessInstanceDAO(org.apache.ode.bpel.dao.ProcessInstanceDAO) BpelDatabase(org.apache.ode.bpel.engine.BpelDatabase) BpelDAOConnection(org.apache.ode.bpel.dao.BpelDAOConnection) InstanceInfoWithEventsType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoWithEventsType)

Aggregations

BpelDAOConnection (org.apache.ode.bpel.dao.BpelDAOConnection)1 ProcessInstanceDAO (org.apache.ode.bpel.dao.ProcessInstanceDAO)1 BpelDatabase (org.apache.ode.bpel.engine.BpelDatabase)1 InstanceManagementException (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.InstanceManagementException)1 InstanceInfoType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoType)1 InstanceInfoWithEventsType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoWithEventsType)1 LimitedInstanceInfoType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.LimitedInstanceInfoType)1