How to Create a Prework Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.ActionActivityParameters;
import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final ActionActivityParameters req = new ActionActivityParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    req.setTime("time");

    out.println(port.preworkActivity(req));
  }

}
Advertisements

How to Suspend an Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.ActionActivityParameters;
import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final ActionActivityParameters req = new ActionActivityParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    req.setTime("time");

    out.println(port.suspendActivity(req));
  }

}

How to Delay an Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.DelayActivityParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final DelayActivityParameters req = new DelayActivityParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    req.setValue(0);

    out.println(port.delayActivity(req));
  }

}

How to Get the Resource Preferences of an Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.GetResourcePreferencesParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final GetResourcePreferencesParameters req = new GetResourcePreferencesParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    out.println(port.getResourcePreferences(req));
  }

}

How to Set the Resource Preferences of an Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.ResourcePreference;
import toa.activity.SetResourcePreferencesParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final SetResourcePreferencesParameters req = new SetResourcePreferencesParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    final ResourcePreference pref = new ResourcePreference();

    pref.setResourceId("resourceId");

    pref.setType("type");

    req.getPreference().add(pref);

    out.println(port.setResourcePreferences(req));
  }

}

How to Search Activities in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.SearchActivitiesParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final SearchActivitiesParameters req = new SearchActivitiesParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setSearchIn("searchIn");

    req.setSearchFor("searchFor");

    req.setDateFrom("dateFrom");

    req.setDateTo("dateTo");

    req.setSelectFrom("selectFrom");

    req.setSelectCount("selectCount");

    out.println(port.searchActivities(req));
  }

}

How to Re-Open an Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.UpdateActivityParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final UpdateActivityParameters req = new UpdateActivityParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    req.setPositionInRoute("positionInRoute");

    out.println(port.reopenActivity(req));
  }

}

How to Update an Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.Property;
import toa.activity.UpdateActivityParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final UpdateActivityParameters req = new UpdateActivityParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    req.setPositionInRoute("positionInRoute");

    final Property prop = new Property();

    prop.setName("name");

    prop.setValue("value");

    req.getProperties().add(prop);

    out.println(port.updateActivity(req));
  }

}

How to Get the Work Skills of an Activity in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.GetActivityWorkSkillsParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final GetActivityWorkSkillsParameters req = new GetActivityWorkSkillsParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setActivityId("activityId");

    out.println(port.getActivityWorkSkills(req));
  }

}

How to List Multi-Day Activities in the Oracle Field Service Cloud with the Activity Management API

import static java.lang.System.out;

import toa.activity.Activity_Service;
import toa.activity.ApiPortType;
import toa.activity.GetMultidayActivitiesParameters;
import toa.activity.User;

public final class OfscSample {

  public static void main(final String[] args) {
    final Activity_Service service = new Activity_Service();

    final ApiPortType port = service.getActivity();

    final GetMultidayActivitiesParameters req = new GetMultidayActivitiesParameters();

    final User user = new User();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    req.setResourceId("resourceId");

    out.println(port.getMultidayActivities(req));
  }

}