Examples of TaskMetadata


Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

        notification.getRoleOwners().add("test/role3");
        ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
        ITaskDAOConnection dao=daoFactory.openConnection();
        server.create(dao,notification, "token1");
        try {
            TaskMetadata metadata = TaskMetadata.Factory.newInstance()
            metadata.setTaskId("taskID");
            metadata.setTaskType(TaskType.NOTIFICATION.name());
            server.update(dao,metadata, "token");
            fail("should not be able to update a notification");
        } catch (Exception e) {
            // expected
        }   
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

        }   
    }
   
    public void testCannotUpdatePAIfNoPrevious() throws Exception {
        ITMSServer server = Utils.createTMSServerJPA();
        TaskMetadata metadata = TaskMetadata.Factory.newInstance()
        metadata.setTaskId("taskID");
        metadata.setTaskType(TaskType.ACTIVITY.name());
        try {
          ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
            ITaskDAOConnection dao=daoFactory.openConnection();
            server.update(dao,metadata, "token");
            fail("should not be able to update a notification");
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

        String id = ""+System.currentTimeMillis();
        PATask pa = getPATask(id);
        ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
        ITaskDAOConnection dao=daoFactory.openConnection();
        server.create(dao,pa, "token1");
        TaskMetadata metadata = TaskMetadata.Factory.newInstance()
        metadata.setTaskId(id);
       
        metadata.setPriority(5);
        metadata.setDescription("desc2");
        //Date date = new Date();
        //tu.setDeadline(date);
       
        server.update(dao,metadata, "token1");
        PATask pa2 = (PATask) server.getTask(dao,pa.getID(), "token1");
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

        om.setNamespace(TaskXMLConstants.TASK_OM_NAMESPACE);
        return om;
    }

    private XmlObject marshalXMLTaskMetadata(Task task, UserRoles roles) {
        TaskMetadata taskMetadataElement = TaskMetadata.Factory.newInstance();
        taskMetadataElement.setTaskId(task.getID());
        if (task instanceof ITaskWithState) {
            taskMetadataElement.setTaskState(((ITaskWithState) task).getState().toString());
        }
        taskMetadataElement.setTaskType(TaskTypeMapper.getTypeClassName(task.getClass()));
        taskMetadataElement.setDescription(task.getDescription());

        if (task instanceof IProcessBoundTask) {
            taskMetadataElement.setProcessId(((IProcessBoundTask) task).getProcessID());
        }
        if (task instanceof IInstanceBoundTask) {
            taskMetadataElement.setInstanceId(((IInstanceBoundTask) task).getInstanceId());
        }
        if (task instanceof InitTask) {
            InitTask itask = (InitTask) task;
            taskMetadataElement.setInitMessageNamespaceURI(itask.getInitMessageNamespaceURI().toString());
            taskMetadataElement.setInitOperationSOAPAction(((InitTask) task).getInitOperationSOAPAction());
            taskMetadataElement.setProcessEndpoint(((InitTask) task).getProcessEndpoint().toString());
        }

        Calendar cal = Calendar.getInstance();
        cal.setTime(task.getCreationDate());
        taskMetadataElement.setCreationDate(cal);

        for (String userOwner : task.getUserOwners()) {
            XmlString XmlStrUserOwner = taskMetadataElement.addNewUserOwner();
            XmlStrUserOwner.setStringValue(userOwner);
        }
        for (String roleOwner : task.getRoleOwners()) {
            XmlString XmlStrRoleOwner = taskMetadataElement.addNewRoleOwner();
            XmlStrRoleOwner.setStringValue(roleOwner);
        }

       
        for (String action : ACTIONS)
            createACL(action, task, roles, taskMetadataElement);

        taskMetadataElement.setFormUrl(task.getFormURL().toString());

        if (task instanceof ITaskWithState) {
            ITaskWithState taskWithState = (ITaskWithState) task;
            if (taskWithState.getState().equals(TaskState.FAILED)) {
                taskMetadataElement.setFailureCode(taskWithState.getFailureCode());
                taskMetadataElement.setFailureReason(taskWithState.getFailureReason());
            }
        }

        if (task instanceof ITaskWithDeadline) {
            ITaskWithDeadline crTask = (ITaskWithDeadline) task;
            if (crTask.getDeadline() != null)
                taskMetadataElement.setDeadline(new XsdDateTime(crTask.getDeadline()));
        }
        if (task instanceof ITaskWithPriority) {
            ITaskWithPriority crTask = (ITaskWithPriority) task;
            if (crTask.getPriority() != null)
                taskMetadataElement.setPriority(crTask.getPriority());
        }

        if (task instanceof ICompleteReportingTask) {
            ICompleteReportingTask crTask = (ICompleteReportingTask) task;
            taskMetadataElement.setUserProcessCompleteSOAPAction(crTask.getCompleteSOAPAction());
        }

        if (task instanceof ITaskWithAttachments) {
            ITaskWithAttachments taskWithAttachments = (ITaskWithAttachments) task;
            Attachments xmlAttachments = taskMetadataElement.addNewAttachments();
            for (Attachment attachment : taskWithAttachments.getAttachments()) {
                com.intalio.bpms.workflow.taskManagementServices20051109.Attachment xmlAttachment = xmlAttachments
                        .addNewAttachment();
                com.intalio.bpms.workflow.taskManagementServices20051109.AttachmentMetadata xmlAttachmentMetadata = xmlAttachment
                        .addNewAttachmentMetadata();

                AttachmentMetadata metadata = attachment.getMetadata();
                xmlAttachmentMetadata.setMimeType(metadata.getMimeType());
                xmlAttachmentMetadata.setFileName(metadata.getFileName());
                xmlAttachmentMetadata.setTitle(metadata.getTitle());
                xmlAttachmentMetadata.setDescription(metadata.getDescription());
                Calendar attachmentCreateDate = Calendar.getInstance();
                attachmentCreateDate.setTime(metadata.getCreationDate());
                xmlAttachmentMetadata.setCreationDate(attachmentCreateDate);

                final URL payloadURL = attachment.getPayloadURL();
                xmlAttachment.setPayloadUrl(payloadURL.toString());
            }
        }

        if (task instanceof IChainableTask) {
            IChainableTask chainableTask = (IChainableTask) task;
            final boolean chainedBefore = chainableTask.isChainedBefore();
            taskMetadataElement.setIsChainedBefore(Boolean.toString(chainedBefore));
            if (chainedBefore) {
                taskMetadataElement.setPreviousTaskId(chainableTask.getPreviousTaskID());
            }
        }

        return taskMetadataElement;
    }
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

  public void testUpdate() throws Exception {
    XmlObject xmlObject = XmlObject.Factory.parse(this.getClass().getResource("/update.xml"));
    Assert.assertNotNull(xmlObject);
        System.out.println(xmlObject.toString());
        Task taskElement = Task.Factory.newInstance();
        TaskMetadata metadata = taskElement.addNewMetadata();
       
        metadata.set(new TaskUnmarshaller().expectElement(xmlObject, "taskMetadata"));
        System.out.println(taskElement.getMetadata().getTaskId());
  }
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

 
  @Test
  public void testUpdateWithUnmarshaller() throws Exception {
    XmlObject xmlObject = XmlObject.Factory.parse(this.getClass().getResource("/update.xml"));
    OMElement om = new XmlTooling().convertDocument(xmlObject);
    TaskMetadata tm = new TaskUnmarshaller().unmarshalPartialTask2(om);
    System.out.println(tm.getTaskId());
  }
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

      ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            OMElement taskElement = requireElement(rootQueue, "taskMetadata");
            TaskMetadata metadata = new TaskUnmarshaller().unmarshalPartialTask2(taskElement);
            String participantToken = requireElementValue(rootQueue, "participantToken");
            _server.update(dao,metadata, participantToken);
            return createOkResponse();
        } catch (Exception e) {
            throw makeFault(e);
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

                _logger.debug(xmlObject.xmlText());
            }
            XmlCursor xmlCursor = xmlObject.newCursor();
            xmlCursor.toStartDoc();
            xmlCursor.toNextToken();
            TaskMetadata taskMetadata = com.intalio.bpms.workflow.taskManagementServices20051109.Task.Factory.newInstance().addNewMetadata();
            taskMetadata.set(xmlCursor.getObject());
            xmlCursor.dispose();
            return taskMetadata;
        } catch (InvalidInputFormatException e) {
            throw e;
        } catch (XmlException e) {
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

            requireElement(xmlObject, "metadata");

            com.intalio.bpms.workflow.taskManagementServices20051109.Task taskElement = com.intalio.bpms.workflow.taskManagementServices20051109.Task.Factory
                            .newInstance();

            TaskMetadata metadataElement = taskElement.addNewMetadata();
            metadataElement.set(expectElement(xmlObject, "metadata"));
            return metadataElement;
        } catch (XmlException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.TaskMetadata

    }
    public TaskMetadata unmarshalPartialTask2(OMElement rootElement) throws InvalidInputFormatException {
      try {
          XmlObject xmlObject = XmlObject.Factory.parse(rootElement.getXMLStreamReader());
          com.intalio.bpms.workflow.taskManagementServices20051109.Task taskElement = com.intalio.bpms.workflow.taskManagementServices20051109.Task.Factory.newInstance();
            TaskMetadata metadata = taskElement.addNewMetadata();
            metadata.set(new TaskUnmarshaller().expectElement(xmlObject, "taskMetadata"));
            return metadata;
        } catch (XmlException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.