/** * Create an instance of {@link NominateTaskCommand } * */ public NominateTaskCommand createNominateTaskCommand() { return new NominateTaskCommand(); }
/** * Create an instance of {@link NominateTaskCommand } * */ public NominateTaskCommand createNominateTaskCommand() { return new NominateTaskCommand(); }
@Override public void nominate( long taskId, String userId, List<OrganizationalEntity> potentialOwners ) { NominateTaskCommand cmd = new NominateTaskCommand(); cmd.setTaskId(taskId); cmd.setUserId(userId); List<org.kie.remote.jaxb.gen.OrganizationalEntity> genOrgEntList = convertKieOrgEntListToGenOrgEntList(potentialOwners); if( genOrgEntList != null ) { cmd.getPotentialOwners().addAll(genOrgEntList); } executeCommand(cmd); }
@Override public RemoteApiResponse nominate( long taskId, String... potentialOwnerUserIds ) { RemoteApiResponse<Void> response; if( potentialOwnerUserIds == null || potentialOwnerUserIds.length == 0 ) { return new RemoteApiResponse<Void>(RemoteOperationStatus.CLIENT_FAILURE, "Null or empty list of potential owner user ids received as argument"); } try { NominateTaskCommand cmd = new NominateTaskCommand(); cmd.setTaskId(taskId); cmd.setUserId(delegate.getConfig().getUserName()); List<org.kie.remote.jaxb.gen.OrganizationalEntity> genOrgEntList = convertStringListToGenOrgEntList(Arrays.asList(potentialOwnerUserIds)); if( genOrgEntList != null ) { cmd.getPotentialOwners().addAll(genOrgEntList); } delegate.executeCommand(cmd); response = new RemoteApiResponse<Void>(); } catch( RemoteClientException rce ) { response = createRemoteApiResponse(rce); } catch( Exception e ) { response = new RemoteApiResponse<Void>(RemoteOperationStatus.UNKNOWN_FAILURE, e); } return response; }