[Anthill-pro] anthill3-remoting/api/
Frederic Jean
frederic.jean at ubisoft.com
Thu Apr 17 11:55:20 CDT 2008
Sorry finaly found my bug
Tnx :)
Frederic
-----Message d'origine-----
De : anthill-pro-bounces at lists.urbancode.com [mailto:anthill-pro-bounces at lists.urbancode.com] De la part de Frederic Jean
Envoyé : 16 avril 2008 17:19
À : AnthillPro user and support list.
Objet : RE: [Anthill-pro] anthill3-remoting/api/
>From a non-originating workflow , i'm trying to run an originating workflow with an eval script , here is the script :
*************script start***************
import com.urbancode.anthill3.runtime.scripting.helpers.*;
import com.urbancode.anthill3.domain.buildrequest.*;
import com.urbancode.anthill3.services.build.*;
import com.urbancode.anthill3.domain.workflow.*;
import com.urbancode.anthill3.domain.security.*;
import com.urbancode.anthill3.domain.project.*;
import com.urbancode.anthill3.domain.profile.*;
import com.ubisoft.anthill.*;
static final private org.apache.log4j.Logger oLogger = org.apache.log4j.Logger.getLogger("ScriptEval");
//create a workflow utility object
WorkflowUtility oWorkflowUtility = new WorkflowUtility();
//fetch the current build request
BuildRequest oCurrentRequest = BuildRequestLookup.getCurrent();
Project oCurrentProject = ProjectLookup.getCurrent();
//create array of properties to pass
Property [] vProperties = new Property[2];
vProperties[0] = new Property();
vProperties[0].Name = "CHANGELIST";
vProperties[0].Value = oCurrentRequest.getProperty("CHANGELIST");
vProperties[0] = new Property();
vProperties[0].Name = "BRANCH";
vProperties[0].Value = oCurrentRequest.getProperty("BRANCH");
Workflow oWorkflowToRun = oCurrentProject.getWorkflow("Candidate");
BuildProfile oBuildProfile = oWorkflowToRun.getBuildProfile();
User oUser = oCurrentRequest.getUser();
RequestSourceEnum eRequestSource = RequestSourceEnum.MANUAL;
BuildRequest oNewRequest = new BuildRequest(oBuildProfile,oUser,eRequestSource,oCurrentRequest);
for(int i=0;i<vProperties.length;i++)
{
oNewRequest.setProperty(vProperties[i].Name, vProperties[i].Value);
}
BuildService.getInstance().runBuild(oNewRequest);
*******end script***************
The script fail with an exception on oNewRequest.setProperty(vProperties[i].Name, vProperties[i].Value);
I thought I could set the property needed by the originating workflow in the oNewRequest object but it doesn't seem to work or it automatically done
With the oCurrentRequest object passed when creating the new BuildRequest object ?
Thank you
Frederic
-----Message d'origine-----
De : anthill-pro-bounces at lists.urbancode.com [mailto:anthill-pro-bounces at lists.urbancode.com] De la part de Ryan Smith
Envoyé : 16 avril 2008 09:53
À : AnthillPro user and support list.
Objet : Re: [Anthill-pro] anthill3-remoting/api/
It was an oversight.
static synchronized public BuildService getInstance();
abstract public void runBuild(BuildRequest request)
throws AnthillRuntimeException, PersistenceRuntimeException;
abstract public void runBuilds(BuildRequest[] requests)
throws AnthillRuntimeException, PersistenceRuntimeException;
abstract public void runWorkflow(BuildRequest request)
throws AnthillRuntimeException, PersistenceRuntimeException;
abstract public void abortBuildRequest(BuildRequest request)
throws AnthillRuntimeException, PersistenceRuntimeException;
abstract public void restartBuild(BuildRequest request)
throws AnthillRuntimeException, PersistenceRuntimeException;
abstract public void restartWorkflow(BuildRequest request)
throws AnthillRuntimeException, PersistenceRuntimeException;
Use runBuild for originating workflows and runWorkflow for non-originating.
Ryan
Frederic Jean wrote:
> I don't find the BuildService object reference in anthill3-remoting api
> , is that intended ?
>
>
>
> Thank you
>
>
>
> Frederic Jean
>
> Programmeur Outils - GT
> Ubisoft (Montreal)
> E-mail: frederic.jean at ubisoft.com
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
--
===========================================================
Ryan Smith. 2044 Euclid Ave., Suite 600
Developer Cleveland, Ohio 44115
Urbancode, Inc.
email: rws at urbancode.com
web: www.urbancode.com phone: 216-858-9000
web: www.anthillpro.com fax: 216-858-9602
===========================================================
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
More information about the Anthill-pro
mailing list