예제 #1
0
        public virtual void testFixVersion()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.Bundling);
            JDFProcessRun pr = n.getAuditPool().addProcessRun(EnumNodeStatus.Completed, null, null);

            pr.setAttribute("Duration", "PT90S", null);
            Assert.AreEqual("PT90S", pr.getAttribute("Duration"));
            n.setAttribute("foo3", "a~.doc");
            n.fixVersion(null);
            Assert.AreEqual("PT1M30S", pr.getAttribute("Duration"));
            Assert.AreEqual("a~.doc", n.getAttribute("foo3"));
        }
예제 #2
0
        ///
        ///	 <summary> * creates a ProcessRun when this is submitted should be called by the receiving device when it initially receives
        ///	 * and enqueues the JDF
        ///	 *  </summary>
        ///	 * <param name="qe"> the queuentry element to copy information from, if null parameters will be genrated on the fly </param>
        ///	 * <returns> the newly created processRun </returns>
        ///
        public virtual JDFProcessRun createSubmitProcessRun(JDFQueueEntry qe)
        {
            JDFProcessRun pr = (JDFProcessRun)addAudit(EnumAuditType.ProcessRun, null);

            pr.setSubmissionTime(new JDFDate());
            if (qe != null)
            {
                pr.setPartMapVector(qe.getPartMapVector());
                pr.copyAttribute(AttributeName.QUEUEENTRYID, qe, null, null, null);
                if (qe.hasAttribute(AttributeName.SUBMISSIONTIME))
                {
                    pr.copyAttribute(AttributeName.SUBMISSIONTIME, qe, null, null, null);
                }
            }
            if (!pr.hasAttribute(AttributeName.SUBMISSIONTIME))
            {
                pr.setSubmissionTime(new JDFDate());
            }
            if (!pr.hasAttribute(AttributeName.QUEUEENTRYID))
            {
                pr.setAttribute("QueueEntryID", "qe_" + JDFElement.uniqueID(0));
            }
            return(pr);
        }