congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
UserImpl.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.jbpm.services.task.impl.model.UserImpl
constructor

Best Java code snippets using org.jbpm.services.task.impl.model.UserImpl.<init> (Showing top 20 results out of 315)

origin: kiegroup/jbpm

@Override
public User newUser( String id ) {
  return new UserImpl(id);
}
origin: kiegroup/jbpm

@Override
public User newUser() {
  return new UserImpl();
}
origin: kiegroup/jbpm

public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {
  id = in.readLong();
  text = in.readUTF();
  addedBy = new UserImpl();
  addedBy.readExternal( in );
  addedAt = new Date( in.readLong() );
}

origin: kiegroup/jbpm

static UserImpl convertToUserImpl(User user) { 
  if( user == null ) { 
    return null;
  }
  if( user instanceof UserImpl ) { 
    return (UserImpl) user;
  } else { 
    return new UserImpl(user.getId());
  }
}
origin: kiegroup/jbpm

public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {
  id = in.readLong();
  name = in.readUTF();
  accessType = AccessType.valueOf( in.readUTF() );
  contentType = in.readUTF();
  attachedBy = new UserImpl();
  attachedBy.readExternal( in );        
  attachedAt = new Date( in.readLong() );
  size = in.readInt( );
  attachmentContentId = in.readLong();
}
origin: kiegroup/jbpm

public TaskFluent setAdminUser(String userId) {
  if(assignments.getBusinessAdministrators().isEmpty()){
    List<OrganizationalEntity> businessAdmins = new ArrayList<OrganizationalEntity>();
    assignments.setBusinessAdministrators(businessAdmins);    
  }
  assignments.getBusinessAdministrators().add(new UserImpl(userId));
  
  return this;
}

origin: kiegroup/jbpm

public TaskFluent addPotentialUser(String userId) {
  if(assignments.getPotentialOwners().isEmpty()){
    List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>();
    assignments.setPotentialOwners(potentialOwners);    
  }
  assignments.getPotentialOwners().add(new UserImpl(userId));
  
  return this;
}

origin: kiegroup/jbpm

  static List<OrganizationalEntity> convertToPersistentOrganizationalEntity(List<OrganizationalEntity> orgEntList) { 
    List<OrganizationalEntity> persistentOrgEnts = orgEntList;
    if( persistentOrgEnts != null && ! persistentOrgEnts.isEmpty() ) {
      persistentOrgEnts = new ArrayList<OrganizationalEntity>(orgEntList.size());
      for( OrganizationalEntity orgEnt : orgEntList ) { 
        if( orgEnt instanceof UserImpl || orgEnt instanceof GroupImpl ) {
          persistentOrgEnts.add(orgEnt);
        } else if( orgEnt instanceof User ) { 
          persistentOrgEnts.add(new UserImpl(orgEnt.getId())); 
        } else if( orgEnt instanceof Group ) { 
          persistentOrgEnts.add(new GroupImpl(orgEnt.getId())); 
        } else { 
          throw new IllegalStateException("Unknown user or group object: " + orgEnt.getClass().getName() );
        }
      }
    } 
    return persistentOrgEnts;
  }
}
origin: kiegroup/jbpm

public TaskFluent setCreatedBy(String userId){
  ((TaskDataImpl)task.getTaskData()).setCreatedBy(new UserImpl(userId));
  return this;
}

origin: kiegroup/jbpm

  public static List<OrganizationalEntity> readOrganizationalEntityList(ObjectInput in) throws IOException, ClassNotFoundException  {
    int size = in.readInt();
    List<OrganizationalEntity> list = new ArrayList<OrganizationalEntity>(size);
    for ( int i = 0; i < size; i++ ) {
      short type = in.readShort();
      if ( type == 0 ) {
        User user = new UserImpl();
        user.readExternal( in );
        list.add( user ); 
      } else {
        Group group = new GroupImpl();
        group.readExternal( in );
        list.add( group );
      }
    }
    return list;
  }    
}
origin: kiegroup/jbpm

actualOwner = new UserImpl();
actualOwner.readExternal(in);
createdBy = new UserImpl();
createdBy.readExternal(in);
origin: kiegroup/jbpm

public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {
  if ( in.readBoolean() ) {
    taskInitiator = new UserImpl();
    taskInitiator.readExternal( in );
  }
  potentialOwners = CollectionUtils.readOrganizationalEntityList( in );
  excludedOwners = CollectionUtils.readOrganizationalEntityList( in );
  taskStakeholders = CollectionUtils.readOrganizationalEntityList( in );
  businessAdministrators = CollectionUtils.readOrganizationalEntityList( in );
  recipients = CollectionUtils.readOrganizationalEntityList( in );
}
origin: kiegroup/jbpm

public void testClaimIsAllowedExcludedOwner() {
  User testUser = new UserImpl("BB8");
origin: kiegroup/jbpm

public void testDelegateIsAllowedExcludedOwnerBusinessAdministrator() {
  User testUser = new UserImpl("BB8");
origin: kiegroup/jbpm

@Test
public void testGetUserTaskLoad() {
  // Prepare and claim 6 tasks by The Emperor
  for (int x = 0; x < 6; x++) {
    TaskFluent task = new TaskFluent()
        .setName("CalculatorTask1")
        .addPotentialUser(DARTH_VADER)
        .setDeploymentID(DEPLOYMENT_ID)
        .setProcessId(PROCESS_ID)
        .setAdminUser(ADMIN);
    createTaskWithoutAssert(task);
  }
  User userVader = new UserImpl(DARTH_VADER);
  TaskContext ctx = new TaskContext();
  EntityManager em = emf.createEntityManager();
  ctx.setPersistenceContext(new JPATaskPersistenceContext(em));
  LoadCalculator calculator = new TotalCompletionTimeLoadCalculator();
  Double userTaskLoad = calculator.getUserTaskLoad(userVader, ctx).getCalculatedLoad();
  Double userTaskLoads = calculator.getUserTaskLoads(Collections.singletonList(userVader), ctx).iterator().next().getCalculatedLoad();
  Assertions.assertThat(userTaskLoad).isGreaterThanOrEqualTo(840.0);
  Assertions.assertThat(userTaskLoads).isEqualTo(userTaskLoad);
  em.close();
}
origin: kiegroup/jbpm

@Test
public void jaxbCommentTest() throws Exception {
  Assume.assumeFalse(getType().equals(TestType.YAML));
  CommentImpl comment = new CommentImpl();
  comment.setAddedAt(new Date());
  comment.setAddedBy(new UserImpl("user"));
  comment.setId(23l);
  comment.setText("ILLUMINATI!");
  JaxbComment jaxbComment = new JaxbComment(comment);
  assertEquals("added at", comment.getAddedAt(), jaxbComment.getAddedAt());
  assertEquals("added by", comment.getAddedBy().getId(), jaxbComment.getAddedById());
  assertEquals("added by", comment.getAddedBy().getId(), jaxbComment.getAddedBy().getId());
  assertEquals("id", comment.getId(), jaxbComment.getId());
  assertEquals("text", comment.getText(), jaxbComment.getText());
  JaxbComment copyJaxbComment = testRoundTrip(jaxbComment);
  Assertions.assertThat(jaxbComment).isEqualToComparingFieldByFieldRecursively(copyJaxbComment);
}
origin: org.jbpm/jbpm-human-task-jpa

public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {
  id = in.readLong();
  text = in.readUTF();
  addedBy = new UserImpl();
  addedBy.readExternal( in );
  addedAt = new Date( in.readLong() );
}

origin: org.jbpm/jbpm-human-task-jpa

public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {
  if ( in.readBoolean() ) {
    taskInitiator = new UserImpl();
    taskInitiator.readExternal( in );
  }
  potentialOwners = CollectionUtils.readOrganizationalEntityList( in );
  excludedOwners = CollectionUtils.readOrganizationalEntityList( in );
  taskStakeholders = CollectionUtils.readOrganizationalEntityList( in );
  businessAdministrators = CollectionUtils.readOrganizationalEntityList( in );
  recipients = CollectionUtils.readOrganizationalEntityList( in );
}
origin: org.jbpm/jbpm-console-ng-human-tasks-backend

@Test
public void testAllowDelegateUserInPotentialOwner() {
  final long takId = 1;
  final String userId = "user";
  final TaskImpl task = new TaskImpl();
  task.setTaskData(new TaskDataImpl());
  final PeopleAssignmentsImpl peopleAssignments = new PeopleAssignmentsImpl();
  peopleAssignments.setPotentialOwners(Collections.<OrganizationalEntity>singletonList(new UserImpl(userId)));
  task.setPeopleAssignments(peopleAssignments);
  when(taskService.getTask(takId)).thenReturn(task);
  assertTrue(taskOperationsService.allowDelegate(takId, userId, Collections.<String>emptySet()));
}
origin: org.jbpm/jbpm-console-ng-human-tasks-backend

@Test
public void testAllowDelegateInitiator() {
  final long takId = 1;
  final String userId = "user";
  final TaskImpl task = new TaskImpl();
  task.setTaskData(new TaskDataImpl());
  final PeopleAssignmentsImpl peopleAssignments = new PeopleAssignmentsImpl();
  peopleAssignments.setTaskInitiator(new UserImpl(userId));
  task.setPeopleAssignments(peopleAssignments);
  when(taskService.getTask(takId)).thenReturn(task);
  assertTrue(taskOperationsService.allowDelegate(takId, userId, Collections.<String>emptySet()));
}
org.jbpm.services.task.impl.modelUserImpl<init>

Popular methods of UserImpl

  • equals
  • hashCode
  • readExternal
  • writeExternal

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now