SharePoint 2010 Workflow Allow to Start if all Parameters are True - sharepoint-2010

I'm working on creating an approval workflow inside of SharePoint. I'm using the approval workflow for a document library. I have a Yes/No check box that is used to tell the workflow to start the approval process or not. I want the workflow to be able to start when the document is created or updated. That way the user does not have to to go to Workflows > Start Workflow. The problem that I'm having is that the workflow starts as soon as it gets created and does not update properly. I have to go in and terminate the workflow. After the workflow is terminated and the check box equals yes, it will send off the approval email. I'm using Stop Workflow if the check box equals no. Is there something that I'm missing? I do not want the workflow to start in any way unless the check box equals yes. Is there a way to terminate the workflow if the check box equals no? Let me know if there is any other information I need to provide.
If check box = No then do not start the approval process and stop workflow / do not start
If the check box = Yes then start the approval process

You can not set condition for automatically started workflow OOB. In your own workflow you can do test at the beginning of workflow and either continue or finish it. If it's not possible to modify the workflow create new one. Do tests in the beginning and run original workflow using InvokeWorkflow activity accordingly.

Related

How to set Owner of SR in Maximo to first viewer

I want to create automation script, every time when I choose ticket in my list in service request and if owner is null to fill owner with logged user. I can not use automation script launch with attribute because I do not use any attribute to start script. I tried to use automation script with object and if I choose event initialize the value it's working when I click on ticket without owner, but when I want to create new ticket I have error with historyflag.
Can I use mxevent=selectrecord somehow?
I use simple code with variable owner=user.
Instead of using the Object->Initialize event for your launch point, you should use Object->Save->Before Save and have an Event Condition of :owner is null and :historyflag = 0. This will cause owner to get set whenever you save and owner is not already set.
In my opinion, this is preferred over what you asked for for several reasons. First, when the user loads the record, they will be able to see that it is unassigned. Second, automated changes to the record will not be made unless the user makes other changes as well. Finally, the user will not be asked to save if they just load the record and then navigate away.
However, if you really want what you asked for, the following script with a launch point on Attribute->Initialize should work.
# When a user loads a record, Maximo makes a new MboSet with just that
# record. Without access to the UI, checking that ours is the only Mbo
# in the set is close to checking that we are NOT on the List tab.
if (not mbo.getThisMboSet().getMbo(1)
and not mbo.isFlagSet(mbo.READONLY)
and not thisvalue):
thisvalue = user

Using Background title as Background in cucumber

Let's say I use Background feature which has the below steps:
Background: My pre-requisites
Given Step one
When Step Two
Then Step Three
....
Then Step Fifteen
So basically my Background has 15 common steps that is required for a set of scenario to run.
My question is : Is it possible to use the Background title My pre-requisites in other feature files, instead of writing down all the 15 steps as Background? Or is there any other way to handle this more gracefully.
You can create a before hook to code the background logic and reuse it across any feature file. Even tag the hook so u can filter out scenarios where u do not want the before hook to run.
Alongside the existing answer, you could also write a new step that compresses the functionality of the 15 steps into one or two steps that express what you are setting up.
The questions revolving around it are these:
Does the business need to know how the user will interact with the site to get to the point where you are ready to begin the test?
Can you bypass how the user will interact with the site to get there without information surrounding the test getting lost in translation between the dev team and the business?
For the former, I would go with a Background. The latter, I would go with a Hook.
For example:
I need to register a user in order to log in as them in my test. The Givens will start at me logging in, so I'll register the user through an API in a Hook.
I need to register a user in order to test the functionality of a new user on exiting the form, and various items surrounding registration, so I'll register the user, starting with some Background steps.

Script to send email notification in Teamcity

I have a requirement to send email to particular group when Teamcity's build goes green and red.
Does anyone has any idea about it ?
It is possible to configure user group and setup email notifications for this group inside TeamCity.
There are a few TeamCity plugins that you can leverage out of the box but the buildstatusnotifier
looks the most promising. You can also setup a job that gets triggerred upon completion of every build for the project you are tracking. This build will do the following:
Make a call for last status of the build project. See TeamCity REST documentation here for context. Replace "insert-base-url-here" with your teamcity base url & "btXXX" with your build id.
http://{insert-base-url-here}/app/rest/builds/buildType:(id:btXXX)/statusIcon
Save the result of this call in a DB or in a txt file
For every subsequent call, check to see if the new value is the same as the previous; if they are do not send an email. If the values do not match then proceed to step four
Send an email to the recipient/distribution list informing them of a change of status in the build status.
My personal preference will be to do all of these in an nant script but those are the steps to take.
You can also look at the Build-status tool (build-status.appspot.com) which can be setup and displayed in a highly visible place that your team will not miss should it turn red.

suggestions for Rails back-end workflow for cleaning up attachments to abandoned drafts?

I'm working on a Rails application. Two of my models are notes and attachments. The user can create notes and add attachments to them. This is standard stuff and I already have this working fine.
Currently, the user must create a note before they can add attachments to it. I'm looking to implement a more streamlined workflow for the user, similar to the familiar email workflow where you can add attachments to an unsaved email. However, the key is that I don't want the user to even have to save a draft of the note before the attachment can be added, and I want this unsaved note to be abandoned if the user navigates away (I don't want to have the additional complexity of unsaved/unpublished notes).
I know that when the note hasn't initially been saved yet, I can create the attachments without the link to the note, and then establish the link when the note gets saved. The part I'm drawing a blank on is how do I remove the unused attachments if the user breaks off the note creation process? Is there a hook that I'm missing that allows me to see that the user broke off?
Without such a hook, the first solution that comes to mind is a nightly cleanup script that runs via cron that would find all of the unattached attachments and remove them (perhaps filtering by attachments that have been created more than 24 hours ago). Is this the best solution?
There really isn't any kind of trigger to let you know when to clean those up, since a user can just leave the site without "logging out" or some other action. So that leaves you with a background job not attached to user action. In your case I think a nightly cron is nice and simple and would fit this situation well.

how do you develop "create site" workflow in SP 2010

i want to try doing this directly in SP2010 designer first. I have never worked with workflow before and haven't found anything that really helped me out online.
Flow:
I go into a global team site. I fill out a form (predefined form i created with specific controls) and click submit (form is validated for input).
Workflow kicks starts sending an email to a user who is defined to approve this workflow.
Once approval is obtained, the workflow completes and creates a Team Site from the information in the initial Form I filled out.
I am sure this is simple for anyone who has been developing workflows, but again this is my first and my first time using SP2010.
Any help starting this would greatly be appreciated. I haven't really found any good examples online for something like this.
We just completed a project exactly like this. We made a list with all the fields necessary to create a site. We attached a custom Approval workflow created in SharePoint Designer and a Workflow Event Receiver. When the Approval workflow finished, the WorkflowCompleted event checked that the workflow outcome was Approved, retrieved the List Item associated to the Task, and passed that List Item to our builder class.