Search in sources :

Example 1 with EventInfo

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

the class CommonTaskUtil method populateTaskEventInfo.

/**
 * Create the TaskEventInfo object from the EventDAO and the TaskDAO.
 * @param eventDAO : The event
 * @param taskDAO : The related task dao.
 *
 * @return : The new TaskEventInfo object.
 */
public static TaskEventInfo populateTaskEventInfo(EventDAO eventDAO, TaskDAO taskDAO) {
    TaskEventInfo eventInfo = new TaskEventInfo();
    eventInfo.setTimestamp(eventDAO.getTimeStamp());
    eventInfo.setEventInitiator(eventDAO.getUser());
    eventInfo.setEventType(eventDAO.getType());
    eventInfo.setNewState(eventDAO.getNewState());
    eventInfo.setOldState(eventDAO.getOldState());
    eventInfo.setTaskInfo(populateTaskInfo(taskDAO));
    return eventInfo;
}
Also used : TaskEventInfo(org.wso2.carbon.humantask.core.api.event.TaskEventInfo)

Example 2 with EventInfo

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

the class InstanceManagementServiceSkeleton method fillEventInfo.

private EventInfoList fillEventInfo(EventInfoList eventInfoList, TEventInfoList infoList) {
    EventInfo[] infoArray = new EventInfo[infoList.sizeOfEventInfoArray()];
    List<TEventInfo> list = infoList.getEventInfoList();
    for (int i = 0; i < list.size(); i++) {
        infoArray[i] = new EventInfo();
        EventInfo eventInfo = infoArray[i];
        TEventInfo listElem = list.get(i);
        eventInfo.setName(listElem.getName());
        eventInfo.setType(listElem.getType());
        eventInfo.setLineNumber(listElem.getLineNumber());
        eventInfo.setTimestamp(listElem.getTimestamp());
    // TODO: need to change schema and validate the methods
    }
    /*
        for (int i = 0; i < list.size(); i++) {
            infoArray[i] = new TEventInfo
            TEventInfoListSequence tEventInfo = infoArray[i];
            //tEventInfo = new TEventInfo();
            org.apache.ode.bpel.pmapi.TEventInfo listElem = list.get(i);
            tEventInfo.setActivityDefinitionId(listElem.getActivityDefinitionId());
            //tEventInfo.setActivityFailureReason(listElem.getActivityFailureReason());
            tEventInfo.setActivityId(listElem.getActivityId());
            tEventInfo.setActivityName(listElem.getActivityName());
            //tEventInfo.setActivityRecoveryAction(listElem.getActivityRecoveryAction());
            tEventInfo.setActivityType(listElem.getActivityType());
            //tEventInfo.setCorrelationKey(listElem.getCorrelationKey());
            //tEventInfo.setCorrelationSet(listElem.getCorrelationSet());
            //tEventInfo.setExplanation(listElem.getExplanation());
            //tEventInfo.setExpression(listElem.getExpression());
            //tEventInfo.setFault(listElem.getFault());
            tEventInfo.setProcessId(listElem.getProcessId());
            tEventInfo.setScopeId(listElem.getScopeId());
            tEventInfo.setScopeName(listElem.getScopeName());

        }*/
    eventInfoList.setEventInfo(infoArray);
    return eventInfoList;
}
Also used : TEventInfo(org.apache.ode.bpel.pmapi.TEventInfo) EventInfo(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.EventInfo) TEventInfo(org.apache.ode.bpel.pmapi.TEventInfo)

Example 3 with EventInfo

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

the class InstanceManagementServiceSkeleton method fillActivityLifeCycleEventsList.

private void fillActivityLifeCycleEventsList(ActivityLifeCycleEventsListType activityLifeCycleEventsList, EventInfoListDocument infoList) {
    List<TEventInfo> list;
    if (infoList.getEventInfoList() == null) {
        list = infoList.addNewEventInfoList().getEventInfoList();
    } else {
        list = infoList.getEventInfoList().getEventInfoList();
    }
    List<EventInfo> eventInfoList = new ArrayList<EventInfo>();
    Map<Long, Boolean> isFaultMap = new HashMap<Long, Boolean>();
    for (TEventInfo tInfo : list) {
        EventInfo info = new EventInfo();
        info.setType(tInfo.getType());
        info.setName(tInfo.getName());
        info.setLineNumber(tInfo.getLineNumber());
        info.setTimestamp(tInfo.getTimestamp());
        info.setActivityId(tInfo.getActivityId());
        info.setActivityName(tInfo.getActivityName());
        if (tInfo.getName().equals("ActivityFailureEvent")) {
            if (isFaultMap.get(tInfo.getActivityId()) == null) {
                isFaultMap.put(tInfo.getActivityId(), true);
            }
        } else if (tInfo.getName().equals("ActivityExecEndEvent")) {
            if (isFaultMap.get(tInfo.getActivityId()) != null) {
                isFaultMap.remove(tInfo.getActivityId());
            }
            isFaultMap.put(tInfo.getActivityId(), false);
        }
        info.setActivityType(tInfo.getActivityType());
        info.setScopeId(tInfo.getScopeId());
        info.setScopeName(tInfo.getScopeName());
        eventInfoList.add(info);
    }
    for (EventInfo info : eventInfoList) {
        boolean isFault = isFaultMap.get(info.getActivityId()) == null ? false : isFaultMap.get(info.getActivityId());
        info.setIsRecoveryRequired(isFault);
        activityLifeCycleEventsList.addEventInfo(info);
    }
}
Also used : TEventInfo(org.apache.ode.bpel.pmapi.TEventInfo) EventInfo(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.EventInfo) TEventInfo(org.apache.ode.bpel.pmapi.TEventInfo) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList)

Aggregations

TEventInfo (org.apache.ode.bpel.pmapi.TEventInfo)2 EventInfo (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.EventInfo)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TaskEventInfo (org.wso2.carbon.humantask.core.api.event.TaskEventInfo)1